From 3e974a1a241656117cccbfe48df38185d687c84e Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Thu, 3 May 2012 21:56:05 +0200 Subject: [PATCH] If-protect on_true and on_false in ast_ifthen since they can be NULL (contrary to ast_ternary where they can't) --- ast.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } -- 2.39.2