]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
some more error situations where typevar wouldn't get freed
authorWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 21 Aug 2012 09:18:40 +0000 (11:18 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 21 Aug 2012 09:18:40 +0000 (11:18 +0200)
parser.c

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