summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorSarita Patra <saritap@vmware.com>2018-08-16 15:41:01 +0200
committerSarita Patra <saritap@vmware.com>2018-08-16 21:15:26 +0200
commit1159c202fcf674f42becc489d5ac3e973a1284f1 (patch)
treecddc3bbbdb29232cd3052ba8b87a98be307634e8 /pimd
parentMerge pull request #2845 from donaldsharp/cmsg_foolishness (diff)
downloadfrr-1159c202fcf674f42becc489d5ac3e973a1284f1.tar.xz
frr-1159c202fcf674f42becc489d5ac3e973a1284f1.zip
pimd: Fix memory leak pim nexthop creation
While terminating pim instance, the memory allocated for pim nexthop should be released before deallocating the memory of pim nexthop cache(pnc). This resolves the memory leak detected in pnc->nexthop creation. Signed-off-by: Sarita Patra <saritap@vmware.com>
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_rp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c
index 3b3e5eb69..515fb5d07 100644
--- a/pimd/pim_rp.c
+++ b/pimd/pim_rp.c
@@ -56,6 +56,8 @@ void pim_rp_list_hash_clean(void *data)
hash_clean(pnc->upstream_hash, NULL);
hash_free(pnc->upstream_hash);
pnc->upstream_hash = NULL;
+ if (pnc->nexthop)
+ nexthops_free(pnc->nexthop);
XFREE(MTYPE_PIM_NEXTHOP_CACHE, pnc);
}