diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-29 13:06:16 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-29 13:06:16 -0400 |
commit | 7a47379f252b4d277df7c289f8a9d3160b50eee0 (patch) | |
tree | 63d98a1f18fdb3cc1807d95ecea0277df59d4be3 /src/test | |
parent | 1a5be3c5e76a9ce07c64499b6cb8a6bad9323113 (diff) | |
parent | f6b30a97a96837e012b296a43cc99018d96bcf13 (diff) | |
download | tor-7a47379f252b4d277df7c289f8a9d3160b50eee0.tar.gz tor-7a47379f252b4d277df7c289f8a9d3160b50eee0.zip |
Merge branch 'maint-0.3.4'
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/hs_test_helpers.c | 6 | ||||
-rw-r--r-- | src/test/test_channelpadding.c | 2 | ||||
-rw-r--r-- | src/test/test_hs_descriptor.c | 11 |
3 files changed, 13 insertions, 6 deletions
diff --git a/src/test/hs_test_helpers.c b/src/test/hs_test_helpers.c index d238bf8e59..cb7b1fe1b7 100644 --- a/src/test/hs_test_helpers.c +++ b/src/test/hs_test_helpers.c @@ -86,6 +86,9 @@ hs_helper_build_intro_point(const ed25519_keypair_t *signing_kp, time_t now, intro_point = ip; done: + if (intro_point == NULL) + tor_free(ip); + return intro_point; } @@ -143,6 +146,9 @@ hs_helper_build_hs_desc_impl(unsigned int no_ip, descp = desc; done: + if (descp == NULL) + tor_free(desc); + return descp; } diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c index 15c6fb23f5..d61c486fa9 100644 --- a/src/test/test_channelpadding.c +++ b/src/test/test_channelpadding.c @@ -774,6 +774,8 @@ test_channelpadding_consensus(void *arg) tt_i64_op(val, OP_LE, 24*60*60*2); done: + tor_free(relay); + free_mock_consensus(); free_fake_channeltls((channel_tls_t*)chan); smartlist_free(connection_array); diff --git a/src/test/test_hs_descriptor.c b/src/test/test_hs_descriptor.c index 5cc0e99c60..75f507bccd 100644 --- a/src/test/test_hs_descriptor.c +++ b/src/test/test_hs_descriptor.c @@ -176,6 +176,9 @@ test_link_specifier(void *arg) ssize_t ret; hs_desc_link_specifier_t spec; smartlist_t *link_specifiers = smartlist_new(); + char buf[256]; + char *b64 = NULL; + link_specifier_t *ls = NULL; (void) arg; @@ -185,9 +188,7 @@ test_link_specifier(void *arg) /* Test IPv4 for starter. */ { - char *b64, buf[256]; uint32_t ipv4; - link_specifier_t *ls; spec.type = LS_IPV4; ret = tor_addr_parse(&spec.u.ap.addr, "1.2.3.4"); @@ -214,9 +215,7 @@ test_link_specifier(void *arg) /* Test IPv6. */ { - char *b64, buf[256]; uint8_t ipv6[16]; - link_specifier_t *ls; spec.type = LS_IPV6; ret = tor_addr_parse(&spec.u.ap.addr, "[1:2:3:4::]"); @@ -246,9 +245,7 @@ test_link_specifier(void *arg) /* Test legacy. */ { - char *b64, buf[256]; uint8_t *id; - link_specifier_t *ls; spec.type = LS_LEGACY_ID; memset(spec.u.legacy_id, 'Y', sizeof(spec.u.legacy_id)); @@ -274,6 +271,8 @@ test_link_specifier(void *arg) } done: + link_specifier_free(ls); + tor_free(b64); smartlist_free(link_specifiers); } |