diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-03-23 14:08:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-23 14:08:29 +0200 |
| commit | 6927446645221898256a6ec37653bb31a301db72 (patch) | |
| tree | 3039c1a7b7ee98a0da74fe99f7f9ef571825a3fa /zebra/zebra_router.c | |
| parent | 9cc377d4d7ccae8a318d0162c5d0d6a6754d8b0a (diff) | |
| parent | d8bc11a592110abdd14d11dfcb2ce623653ecab5 (diff) | |
Merge pull request #13074 from donaldsharp/hash_clean_and_free
*: Add a hash_clean_and_free() function
Diffstat (limited to 'zebra/zebra_router.c')
| -rw-r--r-- | zebra/zebra_router.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index 21e09a81f7..787442f5c8 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -232,20 +232,15 @@ void zebra_router_terminate(void) /* 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); - hash_free(zrouter.nhgs); - - hash_clean(zrouter.rules_hash, zebra_pbr_rules_free); - hash_free(zrouter.rules_hash); - - hash_clean(zrouter.ipset_entry_hash, zebra_pbr_ipset_entry_free), - hash_clean(zrouter.ipset_hash, zebra_pbr_ipset_free); - hash_free(zrouter.ipset_hash); - hash_free(zrouter.ipset_entry_hash); - hash_clean(zrouter.iptable_hash, zebra_pbr_iptable_free); - hash_free(zrouter.iptable_hash); + hash_clean_and_free(&zrouter.nhgs_id, zebra_nhg_hash_free); + hash_clean_and_free(&zrouter.nhgs, NULL); + + hash_clean_and_free(&zrouter.rules_hash, zebra_pbr_rules_free); + + hash_clean_and_free(&zrouter.ipset_entry_hash, + zebra_pbr_ipset_entry_free); + hash_clean_and_free(&zrouter.ipset_hash, zebra_pbr_ipset_free); + hash_clean_and_free(&zrouter.iptable_hash, zebra_pbr_iptable_free); #ifdef HAVE_SCRIPTING zebra_script_destroy(); |
