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 /tests/lib/test_srcdest_table.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 'tests/lib/test_srcdest_table.c')
| -rw-r--r-- | tests/lib/test_srcdest_table.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/lib/test_srcdest_table.c b/tests/lib/test_srcdest_table.c index de0482d694..c1235fe857 100644 --- a/tests/lib/test_srcdest_table.c +++ b/tests/lib/test_srcdest_table.c @@ -121,8 +121,7 @@ static struct test_state *test_state_new(void) static void test_state_free(struct test_state *test) { route_table_finish(test->table); - hash_clean(test->log, log_free); - hash_free(test->log); + hash_clean_and_free(&test->log, log_free); XFREE(MTYPE_TMP, test); } |
