From: Wolfgang (Blub) Bumiller Date: Thu, 3 May 2012 19:56:05 +0000 (+0200) Subject: If-protect on_true and on_false in ast_ifthen since they can be NULL (contrary to... X-Git-Tag: 0.1-rc1~497 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3e974a1a241656117cccbfe48df38185d687c84e;p=xonotic%2Fgmqcc.git If-protect on_true and on_false in ast_ifthen since they can be NULL (contrary to ast_ternary where they can't) --- diff --git a/ast.c b/ast.c index 77d10f0..3e1738c 100644 --- 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); }