Fix memory leak

Some memory could be lost in the error case of
circuit_build_times_parse_state.

Found by Coverity
This commit is contained in:
Sebastian Hahn
2009-09-26 15:38:52 +02:00
committed by Nick Mathewson
parent 0a438c7daf
commit 7f1f6984da
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -427,6 +427,8 @@ circuit_build_times_parse_state(circuit_build_times_t *cbt,
if (!ok) {
*msg = tor_strdup("Unable to parse circuit build times: "
"Unparsable bin number");
SMARTLIST_FOREACH(args, char*, cp, tor_free(cp));
smartlist_free(args);
break;
}
count = (uint32_t)tor_parse_ulong(count_str, 0, 0,
@@ -434,6 +436,8 @@ circuit_build_times_parse_state(circuit_build_times_t *cbt,
if (!ok) {
*msg = tor_strdup("Unable to parse circuit build times: "
"Unparsable bin count");
SMARTLIST_FOREACH(args, char*, cp, tor_free(cp));
smartlist_free(args);
break;
}