From 5751e41993c624211504ebf589829b28b18cc69a Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Sun, 29 Apr 2012 00:41:35 +0200 Subject: [PATCH] After moving ast_instantiate up, the checks which return NULL now must mem_d(self) --- ast.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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; -- 2.39.2