diff --git a/ir.cpp b/ir.cpp index d94558e..facbc33 100644 --- a/ir.cpp +++ b/ir.cpp @@ -1474,6 +1474,7 @@ ir_instr* ir_block_create_call(ir_block *self, lex_ctx_t ctx, const char *label, !ir_instr_op(in, 1, func, false)) { delete in; + delete out; return nullptr; } self->m_instr.push_back(in); diff --git a/parser.cpp b/parser.cpp index 0560849..ddde654 100644 --- a/parser.cpp +++ b/parser.cpp @@ -3159,6 +3159,7 @@ static bool parse_switch_go(parser_t *parser, ast_block *block, ast_expression * } if (!OPTS_FLAG(RELAXED_SWITCH)) { if (!ast_istype(swcase.m_value, ast_value)) { /* || ((ast_value*)swcase.m_value)->m_cvq != CV_CONST) { */ + delete switchnode; parseerror(parser, "case on non-constant values need to be explicitly enabled via -frelaxed-switch"); ast_unref(operand); return false;