From b7b0fcdc948ad9036b0ff8df3b002a4feaf0878f Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sat, 18 Aug 2012 18:01:52 +0200 Subject: [PATCH] ast_return_delete: check if self->operand is actually set before ast_unref-ing it --- ast.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ast.c b/ast.c index fb1bc87..89ae7ac 100644 --- a/ast.c +++ b/ast.c @@ -344,7 +344,8 @@ ast_return* ast_return_new(lex_ctx ctx, ast_expression *expr) void ast_return_delete(ast_return *self) { - ast_unref(self->operand); + if (self->operand) + ast_unref(self->operand); ast_expression_delete((ast_expression*)self); mem_d(self); } -- 2.39.2