X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=parser.c;h=f9793471f94f93bc4314c3be5f9d3ea88dd221a8;hp=49e965a097f0e5813023824e85062b38e3100da8;hb=063c50fce450693f0098cbc4a28efd109cbed01b;hpb=5429b6f18933d108741dff8eed8ca20df80e7b59 diff --git a/parser.c b/parser.c index 49e965a..f979347 100644 --- a/parser.c +++ b/parser.c @@ -2755,7 +2755,12 @@ static bool parse_dowhile(parser_t *parser, ast_block *block, ast_expression **o if (vec_last(parser->breaks) != label || vec_last(parser->continues) != label) { parseerror(parser, "internal error: label stack corrupted"); rv = false; - ast_delete(*out); + /* + * Test for NULL otherwise ast_delete dereferences null pointer + * and boom. + */ + if (*out) + ast_delete(*out); *out = NULL; } else {