mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-21 18:30:52 +00:00
Fix some memory leaks.
This commit is contained in:
parent
a6ac90215b
commit
c74889f648
2 changed files with 12 additions and 4 deletions
12
ftepp.c
12
ftepp.c
|
@ -492,7 +492,7 @@ static bool ftepp_define(ftepp_t *ftepp)
|
|||
break;
|
||||
default:
|
||||
ftepp_error(ftepp, "expected macro name");
|
||||
return false;
|
||||
goto cleanup_false;
|
||||
}
|
||||
|
||||
(void)ftepp_next(ftepp);
|
||||
|
@ -500,14 +500,14 @@ static bool ftepp_define(ftepp_t *ftepp)
|
|||
if (ftepp->token == '(') {
|
||||
macro->has_params = true;
|
||||
if (!ftepp_define_params(ftepp, macro))
|
||||
return false;
|
||||
goto cleanup_false;
|
||||
}
|
||||
|
||||
if (!ftepp_skipspace(ftepp))
|
||||
return false;
|
||||
goto cleanup_false;
|
||||
|
||||
if (!ftepp_define_body(ftepp, macro))
|
||||
return false;
|
||||
goto cleanup_false;
|
||||
|
||||
if (ftepp->output_on)
|
||||
vec_push(ftepp->macros, macro);
|
||||
|
@ -518,6 +518,10 @@ static bool ftepp_define(ftepp_t *ftepp)
|
|||
for (; l < ftepp_ctx(ftepp).line; ++l)
|
||||
ftepp_out(ftepp, "\n", true);
|
||||
return true;
|
||||
|
||||
cleanup_false:
|
||||
ppmacro_delete(macro);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
4
ir.c
4
ir.c
|
@ -3292,6 +3292,8 @@ static void gen_vector_defs(prog_section_def def, const char *name)
|
|||
def.offset++;
|
||||
component[len-1]++;
|
||||
}
|
||||
|
||||
mem_d(component);
|
||||
}
|
||||
|
||||
static void gen_vector_fields(prog_section_field fld, const char *name)
|
||||
|
@ -3320,6 +3322,8 @@ static void gen_vector_fields(prog_section_field fld, const char *name)
|
|||
fld.offset++;
|
||||
component[len-1]++;
|
||||
}
|
||||
|
||||
mem_d(component);
|
||||
}
|
||||
|
||||
static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool islocal)
|
||||
|
|
Loading…
Reference in a new issue