From d976e2e62bdaca2530f87e97730d03f93f662226 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Tue, 22 Oct 2013 14:16:43 +0200 Subject: obj: Check for NULL pointer in nl_object_clone() Signed-off-by: Thomas Graf --- lib/object.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- cgit v0.12