]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
Fix cache manager to not give back a reference it does not own
authorThomas Graf <tgr@deb.localdomain>
Mon, 17 Dec 2007 22:01:06 +0000 (23:01 +0100)
committerThomas Graf <tgr@deb.localdomain>
Mon, 17 Dec 2007 22:01:06 +0000 (23:01 +0100)
lib/cache_mngr.c

index 4e6b1a67a50977c5d4f0d3a5bc35578d8ad9b2ad..b305ac7806f5d6714802e2c3801b50a9cedc4bf9 100644 (file)
 static int include_cb(struct nl_object *obj, struct nl_parser_param *p)
 {
        struct nl_cache_assoc *ca = p->pp_arg;
-       int err;
 
        NL_DBG(2, "Including object %p into cache %p\n", obj, ca->ca_cache);
 #ifdef NL_DEBUG
        if (nl_debug >= 4)
                nl_object_dump(obj, &nl_debug_dp);
 #endif
-       err = nl_cache_include(ca->ca_cache, obj, ca->ca_change);
-
-       nl_object_put(obj);
-
-       return err;
+       return nl_cache_include(ca->ca_cache, obj, ca->ca_change);
 }
 
 static int event_input(struct nl_msg *msg, void *arg)