mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-19 06:40:49 +00:00
After moving ast_instantiate up, the checks which return NULL now must mem_d(self)
This commit is contained in:
parent
674ae4b7da
commit
5751e41993
1 changed files with 7 additions and 6 deletions
13
ast.c
13
ast.c
|
@ -181,13 +181,14 @@ void ast_block_delete(ast_block *self)
|
|||
ast_function* ast_function_new(lex_ctx ctx, const char *name, ast_value *vtype)
|
||||
{
|
||||
ast_instantiate(ast_function, ctx, ast_function_delete);
|
||||
|
||||
if (!vtype)
|
||||
return NULL;
|
||||
if (vtype->isconst)
|
||||
return NULL;
|
||||
if (vtype->vtype != TYPE_FUNCTION)
|
||||
|
||||
if (!vtype ||
|
||||
vtype->isconst ||
|
||||
vtype->vtype != TYPE_FUNCTION)
|
||||
{
|
||||
mem_d(self);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
self->vtype = vtype;
|
||||
self->name = name ? util_strdup(name) : NULL;
|
||||
|
|
Loading…
Reference in a new issue