aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hs_control.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2019-12-04 13:40:03 +0200
committerDavid Goulet <dgoulet@torproject.org>2019-12-10 09:42:05 -0500
commitc959ea7558d059ebcf167d573b7a4327834982c7 (patch)
tree51f6d2e069783632466df4c24777fa04d8465334 /src/test/test_hs_control.c
parent3b64c6b6fc1f41ccfae99b49a56f134ba6ee7662 (diff)
downloadtor-c959ea7558d059ebcf167d573b7a4327834982c7.tar.gz
tor-c959ea7558d059ebcf167d573b7a4327834982c7.zip
hs-v3: Fix memory leak in test_hs_control_store_permanent_creds()
Diffstat (limited to 'src/test/test_hs_control.c')
-rw-r--r--src/test/test_hs_control.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test_hs_control.c b/src/test/test_hs_control.c
index d064f203a6..33ea9ada7f 100644
--- a/src/test/test_hs_control.c
+++ b/src/test/test_hs_control.c
@@ -525,6 +525,7 @@ test_hs_control_store_permanent_creds(void *arg)
{ /* Setup ClientOnionAuthDir */
int ret;
char *perm_creds_dir = tor_strdup(get_fname("permanent_credentials"));
+ get_options_mutable()->ClientOnionAuthDir = perm_creds_dir;
#ifdef _WIN32
ret = mkdir(perm_creds_dir);
@@ -532,8 +533,6 @@ test_hs_control_store_permanent_creds(void *arg)
ret = mkdir(perm_creds_dir, 0700);
#endif
tt_int_op(ret, OP_EQ, 0);
-
- get_options_mutable()->ClientOnionAuthDir = perm_creds_dir;
}
tor_free(args);
@@ -622,6 +621,7 @@ test_hs_control_store_permanent_creds(void *arg)
tt_uint_op(digest256map_size(client_auths), OP_EQ, 0);
done:
+ tor_free(get_options_mutable()->ClientOnionAuthDir);
tor_free(args);
tor_free(cp1);
buf_free(TO_CONN(&conn)->outbuf);