From c6609efc0fdcb1705cf157b4f383152edb7505c6 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Wed, 9 Jan 2008 19:41:58 +0100 Subject: [PATCH] [PATCH] libnl cache management leak --- lib/cache.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cache.c b/lib/cache.c index c1fbea6..285bc31 100644 --- a/lib/cache.c +++ b/lib/cache.c @@ -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) { -- 2.40.0