From: Wolfgang Bumiller Date: Sat, 28 Apr 2012 22:41:35 +0000 (+0200) Subject: After moving ast_instantiate up, the checks which return NULL now must mem_d(self) X-Git-Tag: 0.1-rc1~551 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5751e41993c624211504ebf589829b28b18cc69a;p=xonotic%2Fgmqcc.git After moving ast_instantiate up, the checks which return NULL now must mem_d(self) --- diff --git a/ast.c b/ast.c index aede5aa..faba425 100644 --- a/ast.c +++ b/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;