mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-16 00:21:45 +00:00
two small memory leak fixes on failure paths
This commit is contained in:
parent
167207e98c
commit
8538658e83
2 changed files with 2 additions and 0 deletions
1
ir.cpp
1
ir.cpp
|
@ -1449,6 +1449,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;
|
||||
}
|
||||
vec_push(self->m_instr, in);
|
||||
|
|
|
@ -3127,6 +3127,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;
|
||||
|
|
Loading…
Reference in a new issue