]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix some leaks in the consdiffmgr tests
authorNick Mathewson <nickm@torproject.org>
Mon, 24 Apr 2017 15:45:13 +0000 (11:45 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 24 Apr 2017 15:45:13 +0000 (11:45 -0400)
src/test/test_consdiffmgr.c

index ec4e56ccf816e267001ca086309ce48b5694bc2f..2fb7dd2dfb9fbc0df8154ce956a6133277742e46 100644 (file)
@@ -125,6 +125,7 @@ mock_cpuworker_handle_replies(void)
     return;
   SMARTLIST_FOREACH(fake_cpuworker_queue, fake_work_queue_ent_t *, ent, {
       ent->reply_fn(ent->arg);
+      tor_free(ent);
   });
   smartlist_free(fake_cpuworker_queue);
   fake_cpuworker_queue = NULL;
@@ -615,6 +616,10 @@ test_consdiffmgr_diff_pending(void *arg)
 
  done:
   UNMOCK(cpuworker_queue_work);
+  for (i = 0; i < N; ++i) {
+    tor_free(md_body[i]);
+    networkstatus_vote_free(md_ns[i]);
+  }
 #undef N
 }