summaryrefslogtreecommitdiff
path: root/lib/if_rmap.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 /lib/if_rmap.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 'lib/if_rmap.c')
-rw-r--r--lib/if_rmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/if_rmap.c b/lib/if_rmap.c
index fa8899e9f8..27c41aaa27 100644
--- a/lib/if_rmap.c
+++ b/lib/if_rmap.c
@@ -276,7 +276,7 @@ int config_write_if_rmap(struct vty *vty,
void if_rmap_ctx_delete(struct if_rmap_ctx *ctx)
{
listnode_delete(if_rmap_ctx_list, ctx);
- hash_clean(ctx->ifrmaphash, (void (*)(void *))if_rmap_free);
+ hash_clean_and_free(&ctx->ifrmaphash, (void (*)(void *))if_rmap_free);
if (ctx->name)
XFREE(MTYPE_IF_RMAP_CTX_NAME, ctx);
XFREE(MTYPE_IF_RMAP_CTX, ctx);