summaryrefslogtreecommitdiff
path: root/zebra/zebra_router.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-04-02 13:18:30 -0400
committerGitHub <noreply@github.com>2020-04-02 13:18:30 -0400
commit85775c536183fef1dedd9aac68128a2b0c3761e5 (patch)
tree11d7405b558d597b0dc02c5dcb1048e7eb820067 /zebra/zebra_router.c
parentcde981e77a7d36f32daa5190eb0b63a390873c83 (diff)
parentc25c3ea57a3dcd3b36d86ba76dd34961bcb662f0 (diff)
Merge pull request #6133 from sworleys/NHG-Fix-Dup-Leak
zebra: free unhashable (dup) NHEs via ID table cleanup
Diffstat (limited to 'zebra/zebra_router.c')
-rw-r--r--zebra/zebra_router.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index a891ffb76a..ea2b6752b3 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -223,10 +223,11 @@ void zebra_router_terminate(void)
zebra_vxlan_disable();
zebra_mlag_terminate();
- hash_clean(zrouter.nhgs, zebra_nhg_hash_free);
- hash_free(zrouter.nhgs);
- hash_clean(zrouter.nhgs_id, NULL);
+ /* Free NHE in ID table only since it has unhashable entries as well */
+ hash_clean(zrouter.nhgs_id, zebra_nhg_hash_free);
hash_free(zrouter.nhgs_id);
+ hash_clean(zrouter.nhgs, NULL);
+ hash_free(zrouter.nhgs);
hash_clean(zrouter.rules_hash, zebra_pbr_rules_free);
hash_free(zrouter.rules_hash);