diff options
author | Donald Sharp <sharpd@nvidia.com> | 2023-03-21 13:54:21 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-03-21 13:54:21 +0100 |
commit | d8bc11a592110abdd14d11dfcb2ce623653ecab5 (patch) | |
tree | eee3628586497e48192f65326316f0eb91114011 /zebra/zebra_vxlan_if.c | |
parent | Merge pull request #12816 from gpnaveen/stc_rte_err_msg (diff) | |
download | frr-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 'zebra/zebra_vxlan_if.c')
-rw-r--r-- | zebra/zebra_vxlan_if.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/zebra/zebra_vxlan_if.c b/zebra/zebra_vxlan_if.c index 08e07b60a..3cc7e499b 100644 --- a/zebra/zebra_vxlan_if.c +++ b/zebra/zebra_vxlan_if.c @@ -610,10 +610,7 @@ struct hash *zebra_vxlan_vni_table_create(void) void zebra_vxlan_vni_table_destroy(struct hash *vni_table) { - if (vni_table) { - hash_clean(vni_table, zebra_vxlan_vni_free); - hash_free(vni_table); - } + hash_clean_and_free(&vni_table, zebra_vxlan_vni_free); } int zebra_vxlan_if_vni_table_destroy(struct zebra_if *zif) |