summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Sack <asac@jwsdot.com>2011-10-21 00:31:39 +0200
committerThomas Graf <tgraf@redhat.com>2012-01-11 12:31:40 +0100
commit9819717444e8f58bcf707aac724488c4d5f4e1d7 (patch)
tree164d098fc82cb4fbe2967b36623caf475b5b7f3b
parent4a7791eca1268e24225c33ed1c00c140a14cd955 (diff)
downloadlibnl-9819717444e8f58bcf707aac724488c4d5f4e1d7.tar.gz
avoid dangling co_major_cache reference to NL_AUTO_PROVIDE caches
-rw-r--r--lib/cache_mngr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/cache_mngr.c b/lib/cache_mngr.c
index cf5a951..0be55bc 100644
--- a/lib/cache_mngr.c
+++ b/lib/cache_mngr.c
@@ -378,9 +378,12 @@ void nl_cache_mngr_free(struct nl_cache_mngr *mngr)
if (mngr->cm_handle)
nl_close(mngr->cm_handle);
- for (i = 0; i < mngr->cm_nassocs; i++)
- if (mngr->cm_assocs[i].ca_cache)
+ for (i = 0; i < mngr->cm_nassocs; i++) {
+ if (mngr->cm_assocs[i].ca_cache) {
+ nl_cache_mngt_unprovide(mngr->cm_assocs[i].ca_cache);
nl_cache_free(mngr->cm_assocs[i].ca_cache);
+ }
+ }
free(mngr->cm_assocs);
free(mngr);