]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
Bug Fix: cache_include: Fix object ref release after successful object update
authorroopa <roopa@cumulusnetworks.com>
Thu, 13 Dec 2012 05:48:30 +0000 (21:48 -0800)
committerThomas Graf <tgraf@suug.ch>
Mon, 17 Dec 2012 15:46:58 +0000 (16:46 +0100)
The current code does a rtnl_link_put on new object instead of
old object. This patch fixes it. None of the caches have support
for object update, so this should not have affected anyone yet.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
lib/cache.c

index 8ba3d5bf7761918dbf9e1eaa08d9ccfd9229a031..36c45e170042b48e460aa7b3265913f8bda1e793 100644 (file)
@@ -736,7 +736,7 @@ static int cache_include(struct nl_cache *cache, struct nl_object *obj,
                         */
                        if (nl_object_update(old, obj) == 0) {
                                cb(cache, old, NL_ACT_CHANGE, data);
-                               nl_object_put(obj);
+                               nl_object_put(old);
                                return 0;
                        }