]> granicus.if.org Git - libnl/commitdiff
[PATCH] libnl cache management leak
authorPatrick McHardy <kaber@trash.net>
Wed, 9 Jan 2008 18:41:58 +0000 (19:41 +0100)
committerThomas Graf <tgr@deb.localdomain>
Thu, 10 Jan 2008 11:44:22 +0000 (12:44 +0100)
lib/cache.c

index c1fbea61a26fbd4a0e1e625b004d6960baac3180..285bc316e6a65b2b928c893728d14237f5df55f4 100644 (file)
@@ -505,8 +505,11 @@ static int cache_include(struct nl_cache *cache, struct nl_object *obj,
                old = nl_cache_search(cache, obj);
                if (old) {
                        nl_cache_remove(old);
-                       if (type->mt_act == NL_ACT_DEL && cb)
-                               cb(cache, old, NL_ACT_DEL);
+                       if (type->mt_act == NL_ACT_DEL) {
+                               if (cb)
+                                       cb(cache, old, NL_ACT_DEL);
+                               nl_object_put(old);
+                       }
                }
 
                if (type->mt_act == NL_ACT_NEW) {