diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-02 13:29:24 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-02 13:29:24 -0400 |
commit | 3e2423d19b78ab71cb1ac8205406c7575296ecd3 (patch) | |
tree | ef5af92552187b14fba73a33e64363bbe65ac0cf /src/test/test_address.c | |
parent | 865514e66ef6c99a53ae92b089d24a187513532d (diff) | |
download | tor-3e2423d19b78ab71cb1ac8205406c7575296ecd3.tar.gz tor-3e2423d19b78ab71cb1ac8205406c7575296ecd3.zip |
Update address tests to avoid offending coverity.
Diffstat (limited to 'src/test/test_address.c')
-rw-r--r-- | src/test/test_address.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/test/test_address.c b/src/test/test_address.c index 69de072cfa..a823fd9cd5 100644 --- a/src/test/test_address.c +++ b/src/test/test_address.c @@ -1186,6 +1186,8 @@ helper_create_mock_node(char id_char) static void helper_free_mock_node(node_t *node) { + if (!node) + return; tor_free(node->ri); tor_free(node); } @@ -1237,11 +1239,9 @@ test_address_tor_node_in_same_network_family(void *ignored) NODE_SET_IPV6(node_a, "2606:4700:4700::1001", 1); tt_int_op(nodes_in_same_family(node_a, node_b), OP_EQ, 1); + done: helper_free_mock_node(node_a); helper_free_mock_node(node_b); - - done: - return; } #define ADDRESS_TEST(name, flags) \ @@ -1279,4 +1279,3 @@ struct testcase_t address_tests[] = { ADDRESS_TEST(tor_node_in_same_network_family, 0), END_OF_TESTCASES }; - |