diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-11-17 12:27:25 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-12-08 14:47:19 -0500 |
commit | c92ac9f5cbb4440b5f87c7e0dd6bec5147d72405 (patch) | |
tree | 2cd04944fc6132f5abadddbe6d225801385abcac /src/test | |
parent | 2f086888b14be3998421b29bfc81d037b8073202 (diff) | |
download | tor-c92ac9f5cbb4440b5f87c7e0dd6bec5147d72405.tar.gz tor-c92ac9f5cbb4440b5f87c7e0dd6bec5147d72405.zip |
Convert the rest of src/common's headers to use FREE_AND_NULL
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-timers.c | 2 | ||||
-rw-r--r-- | src/test/test_address.c | 16 | ||||
-rw-r--r-- | src/test/test_handles.c | 2 | ||||
-rw-r--r-- | src/test/test_policy.c | 8 |
4 files changed, 15 insertions, 13 deletions
diff --git a/src/test/test-timers.c b/src/test/test-timers.c index 99715f4333..a0b5b535c2 100644 --- a/src/test/test-timers.c +++ b/src/test/test-timers.c @@ -133,7 +133,7 @@ main(int argc, char **argv) ret = 0; } - timer_free(NULL); + timer_free_(NULL); for (i = 0; i < N_TIMERS; ++i) { timer_free(timers[i]); diff --git a/src/test/test_address.c b/src/test/test_address.c index f36ff6998b..9c88d37a41 100644 --- a/src/test/test_address.c +++ b/src/test/test_address.c @@ -763,7 +763,7 @@ test_address_get_if_addrs_list_internal(void *arg) tt_assert(!smartlist_contains_ipv6_tor_addr(results)); done: - free_interface_address_list(results); + interface_address_list_free(results); return; } @@ -792,7 +792,7 @@ test_address_get_if_addrs_list_no_internal(void *arg) tt_assert(!smartlist_contains_ipv6_tor_addr(results)); done: - free_interface_address_list(results); + interface_address_list_free(results); return; } @@ -834,7 +834,7 @@ test_address_get_if_addrs6_list_internal(void *arg) } done: - free_interface_address6_list(results); + interface_address6_list_free(results); teardown_capture_of_logs(); return; } @@ -878,7 +878,7 @@ test_address_get_if_addrs6_list_no_internal(void *arg) done: teardown_capture_of_logs(); - free_interface_address6_list(results); + interface_address6_list_free(results); return; } @@ -943,8 +943,8 @@ test_address_get_if_addrs_internal_fail(void *arg) done: UNMOCK(get_interface_addresses_raw); UNMOCK(get_interface_address6_via_udp_socket_hack); - free_interface_address6_list(results1); - free_interface_address6_list(results2); + interface_address6_list_free(results1); + interface_address6_list_free(results2); return; } @@ -971,8 +971,8 @@ test_address_get_if_addrs_no_internal_fail(void *arg) done: UNMOCK(get_interface_addresses_raw); UNMOCK(get_interface_address6_via_udp_socket_hack); - free_interface_address6_list(results1); - free_interface_address6_list(results2); + interface_address6_list_free(results1); + interface_address6_list_free(results2); return; } diff --git a/src/test/test_handles.c b/src/test/test_handles.c index 7ddee6e376..03ae0883c6 100644 --- a/src/test/test_handles.c +++ b/src/test/test_handles.c @@ -13,6 +13,8 @@ typedef struct demo_t { } demo_t; HANDLE_DECL(demo, demo_t, static) +#define demo_handle_free(h) \ + FREE_AND_NULL(demo_handle, (h)) HANDLE_IMPL(demo, demo_t, static) static demo_t * diff --git a/src/test/test_policy.c b/src/test/test_policy.c index 83dca2d431..f8aa8ac40b 100644 --- a/src/test/test_policy.c +++ b/src/test/test_policy.c @@ -1318,7 +1318,7 @@ mock_get_interface_address6_list(int severity, return clone_list; done: - free_interface_address6_list(clone_list); + interface_address6_list_free(clone_list); return NULL; } @@ -1393,11 +1393,11 @@ test_policies_reject_interface_address(void *arg) done: addr_policy_list_free(policy); - free_interface_address6_list(public_ipv4_addrs); - free_interface_address6_list(public_ipv6_addrs); + interface_address6_list_free(public_ipv4_addrs); + interface_address6_list_free(public_ipv6_addrs); UNMOCK(get_interface_address6_list); - /* we don't use free_interface_address6_list on these lists because their + /* we don't use interface_address6_list_free on these lists because their * address pointers are stack-based */ smartlist_free(mock_ipv4_addrs); smartlist_free(mock_ipv6_addrs); |