|
@@ -541,6 +541,7 @@ test_single_onion_poisoning(void *arg)
|
|
|
rend_service_t *service_2 = tor_malloc_zero(sizeof(rend_service_t));
|
|
|
char *dir2 = tor_strdup(get_fname_rnd("test_hs_dir2"));
|
|
|
smartlist_t *services = smartlist_new();
|
|
|
+ char *poison_path = NULL;
|
|
|
|
|
|
|
|
|
mock_options->HiddenServiceSingleHopMode = 0;
|
|
@@ -569,8 +570,8 @@ test_single_onion_poisoning(void *arg)
|
|
|
tt_assert(ret == 0);
|
|
|
}
|
|
|
|
|
|
- service_1->directory = dir1;
|
|
|
- service_2->directory = dir2;
|
|
|
+ service_1->directory = tor_strdup(dir1);
|
|
|
+ service_2->directory = tor_strdup(dir2);
|
|
|
|
|
|
dir1 = dir2 = NULL;
|
|
|
|
|
@@ -687,6 +688,7 @@ test_single_onion_poisoning(void *arg)
|
|
|
|
|
|
|
|
|
ret = rend_service_check_dir_and_add(services, mock_options, service_2, 0);
|
|
|
+ tt_assert(ret == 0);
|
|
|
|
|
|
|
|
|
mock_options->HiddenServiceSingleHopMode = 0;
|
|
@@ -706,9 +708,9 @@ test_single_onion_poisoning(void *arg)
|
|
|
|
|
|
|
|
|
* problem. */
|
|
|
- char *poison_path = rend_service_sos_poison_path(service_1);
|
|
|
+ poison_path = rend_service_sos_poison_path(service_1);
|
|
|
+ tt_assert(poison_path);
|
|
|
ret = unlink(poison_path);
|
|
|
- tor_free(poison_path);
|
|
|
tt_assert(ret == 0);
|
|
|
|
|
|
|
|
@@ -765,9 +767,10 @@ test_single_onion_poisoning(void *arg)
|
|
|
tt_assert(ret == 0);
|
|
|
|
|
|
done:
|
|
|
+
|
|
|
+ tor_free(poison_path);
|
|
|
tor_free(dir1);
|
|
|
tor_free(dir2);
|
|
|
-
|
|
|
smartlist_free(services);
|
|
|
rend_service_free(service_1);
|
|
|
rend_service_free(service_2);
|