1
From 8525e3a4082f88bc93f70c996577e2e48eb57d79 Mon Sep 17 00:00:00 2001
2
From: Alexander Sack <asac@jwsdot.com>
3
Date: Fri, 21 Oct 2011 00:31:39 +0200
4
Subject: [PATCH] avoid dangling co_major_cache reference to NL_AUTO_PROVIDE
8
lib/cache_mngr.c | 7 +++++--
9
1 files changed, 5 insertions(+), 2 deletions(-)
11
diff --git a/lib/cache_mngr.c b/lib/cache_mngr.c
12
index cfa676b..69fd4aa 100644
13
--- a/lib/cache_mngr.c
14
+++ b/lib/cache_mngr.c
15
@@ -372,9 +372,12 @@ void nl_cache_mngr_free(struct nl_cache_mngr *mngr)
17
nl_close(mngr->cm_handle);
19
- for (i = 0; i < mngr->cm_nassocs; i++)
20
- if (mngr->cm_assocs[i].ca_cache)
21
+ for (i = 0; i < mngr->cm_nassocs; i++) {
22
+ if (mngr->cm_assocs[i].ca_cache) {
23
+ nl_cache_mngt_unprovide(mngr->cm_assocs[i].ca_cache);
24
nl_cache_free(mngr->cm_assocs[i].ca_cache);
28
free(mngr->cm_assocs);