]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fix some possible NULL access in an error case
authorWolfgang Bumiller <blub@speed.at>
Sun, 6 Jan 2013 23:22:16 +0000 (00:22 +0100)
committerWolfgang Bumiller <blub@speed.at>
Sun, 6 Jan 2013 23:22:16 +0000 (00:22 +0100)
parser.c

index aa3c38e5ae6d7eb434b6b6b591d2adef9832a814..d374af7329a2a272ddc1cc3a0ce31e1a2fe305ee 100644 (file)
--- 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 */