]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Remove a double-free in test_single_onion_poisoning
authorteor <teor2345@gmail.com>
Fri, 2 Dec 2016 19:27:32 +0000 (06:27 +1100)
committerteor <teor2345@gmail.com>
Fri, 2 Dec 2016 19:27:32 +0000 (06:27 +1100)
We were freeing both dir{1,2} directly, and service_{1,2}->directory via
rend_service_free, even though they are the same pointer.

src/test/test_hs.c

index 1039c64fd520acc411844f3c73947676287bdac3..c7aaace0356878b667d5303ef5dd2af512d7a58c 100644 (file)
@@ -570,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);
   /* The services own the directory pointers now */
   dir1 = dir2 = NULL;
   /* Add port to service 1 */