From: Wolfgang Bumiller Date: Sun, 6 Jan 2013 23:22:16 +0000 (+0100) Subject: Fix some possible NULL access in an error case X-Git-Tag: before-library~353^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f4d1ef47401551062b5c46ae7de534a496f52525;p=xonotic%2Fgmqcc.git Fix some possible NULL access in an error case --- diff --git a/parser.c b/parser.c index aa3c38e..d374af7 100644 --- a/parser.c +++ b/parser.c @@ -2165,6 +2165,8 @@ static bool parse_if(parser_t *parser, ast_block *block, ast_expression **out) ast_delete(cond); return false; } + if (!ontrue) + ontrue = (ast_expression*)ast_block_new(parser_ctx(parser)); /* check for an else */ if (!strcmp(parser_tokval(parser), "else")) { /* parse into the 'else' branch */