From: Wolfgang Bumiller Date: Tue, 15 Jan 2013 13:20:08 +0000 (+0100) Subject: fix a possible leak X-Git-Tag: before-library~256 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c7ca5683b9396a5b50d07397bd5867525fedda9d;p=xonotic%2Fgmqcc.git fix a possible leak --- diff --git a/parser.c b/parser.c index d629e13..601775a 100644 --- 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;