From ff00cad2a14ea6dad073761b3dbb4aaa259723d0 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 4 May 2011 16:04:09 -0400 Subject: [PATCH 1/1] Unref: handle null pointers Signed-off-by: Mathieu Desnoyers --- types/types.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/types.c b/types/types.c index 2a9a5092..08324acc 100644 --- a/types/types.c +++ b/types/types.c @@ -255,6 +255,8 @@ void declaration_ref(struct declaration *declaration) void declaration_unref(struct declaration *declaration) { + if (!declaration) + return; if (!--declaration->ref) declaration->declaration_free(declaration); } @@ -266,6 +268,8 @@ void definition_ref(struct definition *definition) void definition_unref(struct definition *definition) { + if (!definition) + return; if (!--definition->ref) definition->declaration->definition_free(definition); } -- 2.34.1