Make sure that we free 'addr' at the end of a pair of addr tests

Fixes a couple of Coverity warnings about possible memory leaks.
Bug not in any released Tor.
This commit is contained in:
Nick Mathewson
2020-04-09 07:54:23 -04:00
parent cca9e1c803
commit 29693b83bc
+2 -4
View File
@@ -1751,10 +1751,9 @@ test_addr_is_valid(void *arg)
get_af_unspec(test_addr);
TEST_ADDR_VALIDITY(test_addr, 0, 0);
TEST_ADDR_VALIDITY(test_addr, 1, 0);
tor_free(test_addr);
done:
;
tor_free(test_addr);
}
#define TEST_ADDR_IS_NULL(a, rv) STMT_BEGIN \
@@ -1797,10 +1796,9 @@ test_addr_is_null(void *arg)
/* Test for address family AF_UNSPEC. */
get_af_unspec(test_addr);
TEST_ADDR_IS_NULL(test_addr, 1);
tor_free(test_addr);
done:
;
tor_free(test_addr);
}
#ifndef COCCI