diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-03-21 08:54:21 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-03-21 08:54:21 -0400 |
| commit | d8bc11a592110abdd14d11dfcb2ce623653ecab5 (patch) | |
| tree | eee3628586497e48192f65326316f0eb91114011 /pimd/pim_rp.c | |
| parent | 2e1ea892220dccb8a4c72e438cb3bbd4cac22b2b (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 'pimd/pim_rp.c')
| -rw-r--r-- | pimd/pim_rp.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index e2ee6656d1..c7516242f5 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -47,9 +47,7 @@ void pim_rp_list_hash_clean(void *data) list_delete(&pnc->rp_list); - hash_clean(pnc->upstream_hash, NULL); - hash_free(pnc->upstream_hash); - pnc->upstream_hash = NULL; + hash_clean_and_free(&pnc->upstream_hash, NULL); if (pnc->nexthop) nexthops_free(pnc->nexthop); |
