]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Ensure that dir1 and dir2 are freed at the end of poisoning test
authorNick Mathewson <nickm@torproject.org>
Wed, 14 Sep 2016 15:01:21 +0000 (11:01 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 14 Sep 2016 15:01:21 +0000 (11:01 -0400)
Found by coverity.

src/test/test_hs.c

index a9cd315a829a97f932160a930a4afbadce896111..fd5ab15643d470973795cf74f70e97a6fba49dd8 100644 (file)
@@ -568,6 +568,7 @@ test_single_onion_poisoning(void *arg)
 
   service_1->directory = dir1;
   service_2->directory = dir2;
+  dir1 = dir2 = NULL;
   smartlist_add(services, service_1);
   /* But don't add the second service yet. */
 
@@ -699,6 +700,8 @@ test_single_onion_poisoning(void *arg)
   smartlist_free(services);
   UNMOCK(get_options);
   tor_free(mock_options->DataDirectory);
+  tor_free(dir1);
+  tor_free(dir2);
 }
 
 struct testcase_t hs_tests[] = {