]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix the very noisy unit test memory leak of CID 420-421.
authorNick Mathewson <nickm@torproject.org>
Tue, 27 Oct 2009 02:18:05 +0000 (22:18 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 27 Oct 2009 02:40:41 +0000 (22:40 -0400)
On any failing case in test_util_config_line, we would leak a couple
of strings.

src/test/test_util.c

index 64f733581bfe1158f3b85c47e22c88b941da6ec2..51b788e725720a04dff3534e9152f75655b692c3 100644 (file)
@@ -88,7 +88,7 @@ static void
 test_util_config_line(void)
 {
   char buf[1024];
-  char *k, *v;
+  char *k=NULL, *v=NULL;
   const char *str;
 
   /* Test parse_config_line_from_str */
@@ -161,7 +161,8 @@ test_util_config_line(void)
   tor_free(k); tor_free(v);
   test_streq(str, "");
  done:
-  ;
+  tor_free(k);
+  tor_free(v);
 }
 
 /** Test basic string functionality. */