Fix some possible NULL access in an error case

This commit is contained in:
Wolfgang Bumiller 2013-01-07 00:22:16 +01:00
parent 4d72c85f73
commit f4d1ef4740

View file

@ -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 */