]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
fix a possible leak
authorWolfgang Bumiller <blub@speed.at>
Tue, 15 Jan 2013 13:20:08 +0000 (14:20 +0100)
committerWolfgang Bumiller <blub@speed.at>
Tue, 15 Jan 2013 13:20:08 +0000 (14:20 +0100)
parser.c

index d629e13be7e34fd43d8dde3176193ccb6c2b0cf2..601775ade7c3e0eb0174fb6ca55a51d8223f9aca 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1684,6 +1684,7 @@ static ast_expression* parse_expression_leave(parser_t *parser, bool stopatcomma
 {
     ast_expression *expr = NULL;
     shunt sy;
+    size_t i;
     bool wantop = false;
     /* only warn once about an assignment in a truth value because the current code
      * would trigger twice on: if(a = b && ...), once for the if-truth-value, once for the && part
@@ -2141,6 +2142,10 @@ static ast_expression* parse_expression_leave(parser_t *parser, bool stopatcomma
 
 onerr:
     parser->lex->flags.noops = true;
+    for (i = 0; i < vec_size(sy.out); ++i) {
+        if (sy.out[i].out)
+            ast_unref(sy.out[i].out);
+    }
     vec_free(sy.out);
     vec_free(sy.ops);
     return NULL;