#include "list.h"
#include "rendimento.h"
#include "pagamento.h"
+#include "bem.h"
#include "pmhash.h"
struct declaracao * declaracao_new(int ano)
dec->pagamentos = list_new();
if (!dec->pagamentos)
goto out_pagamentos;
+ dec->bens = list_new();
+ if (!dec->bens)
+ goto out_bens;
dec->totais = pmhash_new();
if (!dec->totais)
goto out_totais;
dec->tipo = SIMPLES;
return dec;
out_totais:
+ list_free(dec->bens, bem_free);
+out_bens:
list_free(dec->pagamentos, pagamento_free);
out_pagamentos:
list_free(dec->rendimento, rendimento_free);
free(dec->dvconta);
list_free(dec->rendimento, rendimento_free);
list_free(dec->pagamentos, pagamento_free);
+ list_free(dec->bens, bem_free);
pmhash_del(dec->totais);
free(dec);
}