Fix the very noisy unit test memory leak of CID 420-421.

On any failing case in test_util_config_line, we would leak a couple
of strings.
This commit is contained in:
Nick Mathewson 2009-10-26 22:18:05 -04:00
parent caa141617f
commit 134ac8059b

View File

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