summaryrefslogtreecommitdiff
path: root/zebra/zebra_l2_bridge_if.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-03-21 08:54:21 -0400
committerDonald Sharp <sharpd@nvidia.com>2023-03-21 08:54:21 -0400
commitd8bc11a592110abdd14d11dfcb2ce623653ecab5 (patch)
treeeee3628586497e48192f65326316f0eb91114011 /zebra/zebra_l2_bridge_if.c
parent2e1ea892220dccb8a4c72e438cb3bbd4cac22b2b (diff)
*: 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_l2_bridge_if.c')
-rw-r--r--zebra/zebra_l2_bridge_if.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/zebra/zebra_l2_bridge_if.c b/zebra/zebra_l2_bridge_if.c
index b85d39bcd6..00450ddd36 100644
--- a/zebra/zebra_l2_bridge_if.c
+++ b/zebra/zebra_l2_bridge_if.c
@@ -142,10 +142,7 @@ static void *zebra_l2_bridge_vlan_alloc(void *p)
static void zebra_l2_bridge_vlan_table_destroy(struct hash *vlan_table)
{
- if (vlan_table) {
- hash_clean(vlan_table, zebra_l2_bridge_vlan_free);
- hash_free(vlan_table);
- }
+ hash_clean_and_free(&vlan_table, zebra_l2_bridge_vlan_free);
}
static struct hash *zebra_l2_bridge_vlan_table_create(void)