]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Test: Fix memory leaks and missing unmocks in entry guard tests
authorteor <teor@torproject.org>
Wed, 21 Nov 2018 05:56:30 +0000 (15:56 +1000)
committerteor <teor@torproject.org>
Thu, 22 Nov 2018 06:42:32 +0000 (16:42 +1000)
test_entry_guard_outdated_dirserver_exclusion leaks memory, and is
missing some unmocks.

Fixes 28554; bugfix on 0.3.0.1-alpha.

changes/bug28554 [new file with mode: 0644]
src/test/test_entrynodes.c

diff --git a/changes/bug28554 b/changes/bug28554
new file mode 100644 (file)
index 0000000..9a0b281
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes (unit tests, guard selection):
+    - Stop leaking memory in an entry guard unit test. Fixes bug 28554;
+      bugfix on 0.3.0.1-alpha.
index 505e09e36f26a5b86d6531aec1fa2f89773b06a4..3b54ffa2e938077b8087a79a6072ed0cdbfb0035 100644 (file)
@@ -2779,13 +2779,16 @@ test_entry_guard_outdated_dirserver_exclusion(void *arg)
                                   digests, 3, 7, 0);
 
     /* ... and check that because we failed to fetch microdescs from all our
-     * primaries, we didnt end up selecting a primary for fetching dir info */
+     * primaries, we didn't end up selecting a primary for fetching dir info */
     expect_log_msg_containing("No primary or confirmed guards available.");
     teardown_capture_of_logs();
   }
 
  done:
+  UNMOCK(networkstatus_get_latest_consensus_by_flavor);
+  UNMOCK(directory_initiate_request);
   smartlist_free(digests);
+  tor_free(mock_ns_val);
   tor_free(args);
   if (conn) {
     tor_free(conn->requested_resource);