ast_return_delete: check if self->operand is actually set before ast_unref-ing it

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-18 18:01:52 +02:00
parent 586bb07c4d
commit b7b0fcdc94

3
ast.c
View file

@ -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);
}