summaryrefslogtreecommitdiff
path: root/zebra/zebra_router.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-08-04 07:05:46 -0400
committerDonald Sharp <sharpd@nvidia.com>2022-08-05 07:51:27 -0400
commitd5795103bc1dc4aada29b1ae7a052a97e07eb8bc (patch)
treebca9a45b55d8dac372613c3627e696b5c9beb098 /zebra/zebra_router.c
parent34a67a7d1eb1dff6cef5caf8aa85763cc98c31fb (diff)
zebra: Fix memory leaks and use after frees in nhg's on shutdown
Fixup both memory leaks as well as use after free's in nhg's on shutdown. This approach is effectively just iterating through all the hash items and directly just freeing the memory instead of handling ref counts or cross references. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_router.c')
-rw-r--r--zebra/zebra_router.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index f7ad30b41f..24e71b4a8b 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -246,6 +246,7 @@ void zebra_router_terminate(void)
zebra_neigh_terminate();
/* Free NHE in ID table only since it has unhashable entries as well */
+ hash_iterate(zrouter.nhgs_id, zebra_nhg_hash_free_zero_id, NULL);
hash_clean(zrouter.nhgs_id, zebra_nhg_hash_free);
hash_free(zrouter.nhgs_id);
hash_clean(zrouter.nhgs, NULL);