summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_gr_helper.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-03-21 13:54:21 +0100
committerDonald Sharp <sharpd@nvidia.com>2023-03-21 13:54:21 +0100
commitd8bc11a592110abdd14d11dfcb2ce623653ecab5 (patch)
treeeee3628586497e48192f65326316f0eb91114011 /ospf6d/ospf6_gr_helper.c
parentMerge pull request #12816 from gpnaveen/stc_rte_err_msg (diff)
downloadfrr-d8bc11a592110abdd14d11dfcb2ce623653ecab5.tar.xz
frr-d8bc11a592110abdd14d11dfcb2ce623653ecab5.zip
*: Add a hash_clean_and_free() function
Add a hash_clean_and_free() function as well as convert the code to use it. This function also takes a double pointer to the hash to set it NULL. Also it cleanly does nothing if the pointer is NULL( as a bunch of code tested for ). Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ospf6d/ospf6_gr_helper.c')
-rw-r--r--ospf6d/ospf6_gr_helper.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ospf6d/ospf6_gr_helper.c b/ospf6d/ospf6_gr_helper.c
index bf570a0b2..3df0580fc 100644
--- a/ospf6d/ospf6_gr_helper.c
+++ b/ospf6d/ospf6_gr_helper.c
@@ -110,10 +110,8 @@ static void ospf6_enable_rtr_hash_destroy(struct ospf6 *ospf6)
if (ospf6->ospf6_helper_cfg.enable_rtr_list == NULL)
return;
- hash_clean(ospf6->ospf6_helper_cfg.enable_rtr_list,
- ospf6_disable_rtr_hash_free);
- hash_free(ospf6->ospf6_helper_cfg.enable_rtr_list);
- ospf6->ospf6_helper_cfg.enable_rtr_list = NULL;
+ hash_clean_and_free(&ospf6->ospf6_helper_cfg.enable_rtr_list,
+ ospf6_disable_rtr_hash_free);
}
/*