]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
ast_return_delete: check if self->operand is actually set before ast_unref-ing it
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 16:01:52 +0000 (18:01 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 16:01:52 +0000 (18:01 +0200)
ast.c

diff --git a/ast.c b/ast.c
index fb1bc87e40ed1689661faf4490df3e8773ff8d9e..89ae7accf531dceb42c68e37ac3bb955b962e045 100644 (file)
--- 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);
 }