thanks valgrind...
Signed-off-by: NeilBrown <neilb@suse.de>
if (!s)
return;
free_statement(s->next);
+ free_expression(s->expr);
free_statement(s->thenpart);
free_statement(s->elsepart);
free(s);
.word_cont = "",
};
parse_itest(s->code, &config, argc > 2 ? stderr : NULL);
+ while (s) {
+ struct section *t = s->next;
+ code_free(s->code);
+ free(s);
+ s = t;
+ }
exit(0);
}
continue;
fprintf(f, "\tcase %d:\n", s->num);
- if (s->isref)
+ if (s->isref) {
fprintf(f, "\t\tfree_%.*s(*(void**)asn);\n",
s->struct_name.len,
s->struct_name.txt);
- else
+ fprintf(f, "\t\tfree(asn);\n");
+ } else
fprintf(f, "\t\tfree_%.*s(asn);\n",
s->struct_name.len,
s->struct_name.txt);
.word_cont = "",
};
parse_calc(s->code, &config, argc > 2 ? stderr : NULL);
+ while (s) {
+ struct section *t = s->next;
+ code_free(s->code);
+ free(s);
+ s = t;
+ }
exit(0);
}