summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2013-10-22 14:16:43 +0200
committerThomas Graf <tgraf@suug.ch>2013-10-22 14:20:41 +0200
commitd976e2e62bdaca2530f87e97730d03f93f662226 (patch)
tree3a27f055697e988075710a81848558fb8b7cd8d1
parent978bb85c7aa7dcd5d7fd3e4123be2b6e7b7094a2 (diff)
downloadlibnl-d976e2e62bdaca2530f87e97730d03f93f662226.tar.gz
obj: Check for NULL pointer in nl_object_clone()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
-rw-r--r--lib/object.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/object.c b/lib/object.c
index 9293df99..c3751a6f 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;