mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 06:02:22 +00:00
Fix more bugs (mostly possible NULL pointer dereferences)
This commit is contained in:
parent
996d998ebb
commit
fe296de42f
3 changed files with 4 additions and 3 deletions
2
ast.c
2
ast.c
|
@ -1563,7 +1563,7 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield)
|
|||
return true;
|
||||
|
||||
error: /* clean up */
|
||||
ir_value_delete(v);
|
||||
if(v) ir_value_delete(v);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
2
main.c
2
main.c
|
@ -791,7 +791,7 @@ cleanup:
|
|||
vec_free(ppems);
|
||||
|
||||
if (!OPTS_OPTION_BOOL(OPTION_PP_ONLY))
|
||||
parser_cleanup(parser);
|
||||
if(parser) parser_cleanup(parser);
|
||||
if (opts_output_free)
|
||||
mem_d(OPTS_OPTION_STR(OPTION_OUTPUT));
|
||||
if (operators_free)
|
||||
|
|
3
parser.c
3
parser.c
|
@ -3622,7 +3622,8 @@ static bool parse_goto(parser_t *parser, ast_expression **out)
|
|||
if (!(expression = parse_expression(parser, false, true)) ||
|
||||
!(*out = parse_goto_computed(parser, &expression))) {
|
||||
parseerror(parser, "invalid goto expression");
|
||||
ast_unref(expression);
|
||||
if(expression)
|
||||
ast_unref(expression);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue