ast_expression_delete: delete varparam if it is set - fixes another leak
authorWolfgang Bumiller <blub@speed.at>
Mon, 15 Apr 2013 19:05:59 +0000 (21:05 +0200)
committerWolfgang Bumiller <blub@speed.at>
Mon, 15 Apr 2013 19:05:59 +0000 (21:05 +0200)
ast.c
parser.c

diff --git a/ast.c b/ast.c
index 039beb145000b7d3b195128e6c3ded0404189523..22c4defd76c694d3b696a6509c8408dc2c27934b 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -87,6 +87,8 @@ static void ast_expression_delete(ast_expression *self)
         ast_delete(self->expression.params[i]);
     }
     vec_free(self->expression.params);
+    if (self->expression.varparam)
+        ast_delete(self->expression.varparam);
 }
 
 static void ast_expression_delete_full(ast_expression *self)
index db714549af5b9415ddc4b245503dbc9f5c8ab7b1..088cbff1fe2d25a2eb72013eab1f794da248f764 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -4791,6 +4791,8 @@ static ast_value *parse_parameter_list(parser_t *parser, ast_value *var)
 on_error:
     if (argcounter)
         mem_d(argcounter);
+    if (varparam)
+        ast_delete(varparam);
     ast_delete(var);
     for (i = 0; i < vec_size(params); ++i)
         ast_delete(params[i]);