mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +00:00
Fix some possible NULL access in an error case
This commit is contained in:
parent
4d72c85f73
commit
f4d1ef4740
1 changed files with 2 additions and 0 deletions
2
parser.c
2
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 */
|
||||
|
|
Loading…
Reference in a new issue