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 /lib/ferr.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 'lib/ferr.c')
-rw-r--r-- | lib/ferr.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/ferr.c b/lib/ferr.c index 5998befec..33bcb075f 100644 --- a/lib/ferr.c +++ b/lib/ferr.c @@ -180,9 +180,7 @@ void log_ref_init(void) void log_ref_fini(void) { frr_with_mutex (&refs_mtx) { - hash_clean(refs, NULL); - hash_free(refs); - refs = NULL; + hash_clean_and_free(&refs, NULL); } } |