summaryrefslogtreecommitdiff
path: root/src/test/test_hs_descriptor.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-04 14:27:45 -0400
committerNick Mathewson <nickm@torproject.org>2016-11-04 14:27:45 -0400
commitd16b4b3e485526b39e7bdc36bf2d8041080a7201 (patch)
treecc0f2f7299a2f928b82bffceea36515ef8c8e914 /src/test/test_hs_descriptor.c
parenta4291eef5aeeb9ba8939b563a657ac50d4447b7e (diff)
downloadtor-d16b4b3e485526b39e7bdc36bf2d8041080a7201.tar.gz
tor-d16b4b3e485526b39e7bdc36bf2d8041080a7201.zip
Fix memory leaks in hs_descriptor/decode_descriptor and in encode_enc_key()
Diffstat (limited to 'src/test/test_hs_descriptor.c')
-rw-r--r--src/test/test_hs_descriptor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/test_hs_descriptor.c b/src/test/test_hs_descriptor.c
index 846732cb68..838d7cdb3d 100644
--- a/src/test/test_hs_descriptor.c
+++ b/src/test/test_hs_descriptor.c
@@ -498,6 +498,7 @@ test_decode_descriptor(void *arg)
char *encoded = NULL;
hs_descriptor_t *desc = helper_build_hs_desc(0);
hs_descriptor_t *decoded = NULL;
+ hs_descriptor_t *desc_no_ip = NULL;
(void) arg;
@@ -517,7 +518,7 @@ test_decode_descriptor(void *arg)
/* Decode a descriptor with _no_ introduction points. */
{
- hs_descriptor_t *desc_no_ip = helper_build_hs_desc(1);
+ desc_no_ip = helper_build_hs_desc(1);
tt_assert(desc_no_ip);
tor_free(encoded);
ret = hs_desc_encode_descriptor(desc_no_ip, &encoded);
@@ -531,6 +532,7 @@ test_decode_descriptor(void *arg)
done:
hs_descriptor_free(desc);
+ hs_descriptor_free(desc_no_ip);
hs_descriptor_free(decoded);
tor_free(encoded);
}