Merge pull request #180 from xonotic/mem_leak_fix_on_failure_paths
[xonotic/gmqcc.git] / parser.cpp
index 0560849e35719956c4f8f6c86bf05fdf319461a9..ddde65469ec77e7cb596e58451dc88096c5ad8f1 100644 (file)
@@ -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;