]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
If-protect on_true and on_false in ast_ifthen since they can be NULL (contrary to...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 3 May 2012 19:56:05 +0000 (21:56 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 3 May 2012 19:56:05 +0000 (21:56 +0200)
ast.c

diff --git a/ast.c b/ast.c
index 77d10f0feb781214aa6c39fe2d084189bca9cc52..3e1738c73d00a14cda4418de137baca9b1d57538 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -238,8 +238,10 @@ ast_ifthen* ast_ifthen_new(lex_ctx ctx, ast_expression *cond, ast_expression *on
 void ast_ifthen_delete(ast_ifthen *self)
 {
     ast_unref(self->cond);
-    ast_unref(self->on_true);
-    ast_unref(self->on_false);
+    if (self->on_true)
+        ast_unref(self->on_true);
+    if (self->on_flase)
+        ast_unref(self->on_false);
     ast_expression_delete((ast_expression*)self);
     mem_d(self);
 }