/* parse on */
if (!parser_next(parser)) {
ast_delete(var);
+ mem_d(name);
parseerror(parser, "error after variable or field declaration");
return NULL;
}
if (parser->tok == '[') {
wasarray = true;
var = parse_arraysize(parser, var);
- if (!var)
+ if (!var) {
+ if (name) mem_d(name);
return NULL;
+ }
}
/* This is the point where we can turn it into a field */
while (parser->tok == '(') {
var = parse_parameter_list(parser, var);
if (!var) {
- if (name)
- mem_d((void*)name);
+ if (name) mem_d(name);
return NULL;
}
}
if (name) {
if (!ast_value_set_name(var, name)) {
ast_delete(var);
+ mem_d(name);
parseerror(parser, "internal error: failed to set name");
return NULL;
}
/* free the name, ast_value_set_name duplicates */
- mem_d((void*)name);
+ mem_d(name);
}
return var;
void util_meminfo() {
struct memblock_t *info;
-
if (OPTS_OPTION_BOOL(OPTION_DEBUG)) {
for (info = mem_start; info; info = info->next) {
con_out("lost: %u (bytes) at %s:%u\n",
info->file,
info->line);
- util_dumpmem(info, OPTS_OPTION_U16(OPTION_MEMDUMPCOLS));
+ util_dumpmem(info + 1, OPTS_OPTION_U16(OPTION_MEMDUMPCOLS));
}
}