]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
fix a unit tests memory leak (my fault)
authorNick Mathewson <nickm@torproject.org>
Tue, 3 Feb 2015 20:58:48 +0000 (15:58 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 3 Feb 2015 20:58:48 +0000 (15:58 -0500)
src/test/test_dir.c

index 84e80ea760e322bf28b3fa40a011ee1b12b989af..849bbdbef67fb4a928cc5cb476f56dc6dd8c74c3 100644 (file)
@@ -2994,7 +2994,6 @@ test_dir_packages(void *arg)
   BAD("sha512= sha256="
       "3c179f46ca77069a6a0bac70212a9b3b838b2f66129cb52d568837fc79d8fcc7");
 
-  votes = smartlist_new();
   smartlist_add(votes, tor_malloc_zero(sizeof(networkstatus_t)));
   smartlist_add(votes, tor_malloc_zero(sizeof(networkstatus_t)));
   smartlist_add(votes, tor_malloc_zero(sizeof(networkstatus_t)));
@@ -3097,6 +3096,7 @@ test_dir_packages(void *arg)
  done:
   SMARTLIST_FOREACH(votes, networkstatus_t *, ns,
                     { smartlist_free(ns->package_lines); tor_free(ns); });
+  smartlist_free(votes);
   tor_free(res);
 }