Unref: handle null pointers
[babeltrace.git] / types / types.c
index 2a9a50922c6f5b62c2cc212b513bffdbb98eb2ba..08324acc481dd5e594525282d3329d4a15459f41 100644 (file)
@@ -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);
 }
This page took 0.022806 seconds and 4 git commands to generate.