some more error situations where typevar wouldn't get freed

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-21 11:18:40 +02:00
parent 0674457c51
commit d7f43dfa4d

View file

@ -2006,6 +2006,7 @@ static bool parser_variable(parser_t *parser, ast_block *localblock)
fval = ast_value_new(ctx, var->name, TYPE_FUNCTION); fval = ast_value_new(ctx, var->name, TYPE_FUNCTION);
if (!fval) { if (!fval) {
ast_value_delete(var); ast_value_delete(var);
ast_value_delete(typevar);
if (fval) ast_value_delete(fval); if (fval) ast_value_delete(fval);
return false; return false;
} }
@ -2023,6 +2024,7 @@ static bool parser_variable(parser_t *parser, ast_block *localblock)
proto->name, proto->name,
ast_ctx(proto).file, ast_ctx(proto).line); ast_ctx(proto).file, ast_ctx(proto).line);
ast_value_delete(fval); ast_value_delete(fval);
ast_value_delete(typevar);
return false; return false;
} }
/* copy over the parameter names */ /* copy over the parameter names */
@ -2048,6 +2050,7 @@ static bool parser_variable(parser_t *parser, ast_block *localblock)
varentry_t vx, vy, vz; varentry_t vx, vy, vz;
if (!create_vector_members(parser, var, &vx, &vy, &vz)) { if (!create_vector_members(parser, var, &vx, &vy, &vz)) {
ast_delete(var); ast_delete(var);
ast_value_delete(typevar);
return false; return false;
} }
@ -2071,6 +2074,7 @@ static bool parser_variable(parser_t *parser, ast_block *localblock)
parser_pop_local(parser); parser_pop_local(parser);
parser_pop_local(parser); parser_pop_local(parser);
ast_value_delete(var); ast_value_delete(var);
ast_value_delete(typevar);
return false; return false;
} }
} }
@ -2081,12 +2085,14 @@ static bool parser_variable(parser_t *parser, ast_block *localblock)
( localblock && !parser_t_locals_add(parser, varent)) ) ( localblock && !parser_t_locals_add(parser, varent)) )
{ {
ast_value_delete(var); ast_value_delete(var);
ast_value_delete(typevar);
return false; return false;
} }
if (localblock && !ast_block_locals_add(localblock, var)) if (localblock && !ast_block_locals_add(localblock, var))
{ {
parser_pop_local(parser); parser_pop_local(parser);
ast_value_delete(var); ast_value_delete(var);
ast_value_delete(typevar);
return false; return false;
} }
} }