diff --git a/lib/object.c b/lib/object.c index 17b98f6..b1ebe51 100644 --- a/lib/object.c +++ b/lib/object.c @@ -165,7 +165,12 @@ int nl_object_update(struct nl_object *dst, struct nl_object *src) */ void nl_object_free(struct nl_object *obj) { - struct nl_object_ops *ops = obj_ops(obj); + struct nl_object_ops *ops; + + if (!obj) + return; + + ops = obj_ops(obj); if (obj->ce_refcnt > 0) NL_DBG(1, "Warning: Freeing object in use...\n");