summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/object.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/object.c b/lib/object.c
index 9293df9..c3751a6 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -114,6 +114,9 @@ struct nl_object *nl_object_clone(struct nl_object *obj)
int doff = offsetof(struct nl_derived_object, data);
int size;
+ if (!obj)
+ return NULL;
+
new = nl_object_alloc(ops);
if (!new)
return NULL;