diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-04-09 07:54:23 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-04-09 07:54:23 -0400 |
commit | 29693b83bcfef517469d3afe7a54195adf7f378f (patch) | |
tree | 81ab7894391e3d1f6ef03a4b9ecca11bf59af534 /src/test | |
parent | cca9e1c803161e41df418498e267605d855b7ac5 (diff) | |
download | tor-29693b83bcfef517469d3afe7a54195adf7f378f.tar.gz tor-29693b83bcfef517469d3afe7a54195adf7f378f.zip |
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.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_addr.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/test_addr.c b/src/test/test_addr.c index 82d388b2aa..cf5aad7e71 100644 --- a/src/test/test_addr.c +++ b/src/test/test_addr.c @@ -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 |