aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2009-09-26 15:38:52 +0200
committerNick Mathewson <nickm@torproject.org>2009-09-27 12:00:02 -0400
commit7f1f6984daba22c4e95d9338a4b4433c142ebd23 (patch)
tree269254670b163293042a3a90cc6fc39bf091ea41 /src
parent0a438c7daf19228e04cf71a5c68cb9d701685e58 (diff)
downloadtor-7f1f6984daba22c4e95d9338a4b4433c142ebd23.tar.gz
tor-7f1f6984daba22c4e95d9338a4b4433c142ebd23.zip
Fix memory leak
Some memory could be lost in the error case of circuit_build_times_parse_state. Found by Coverity
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index adf53a8b10..5c3a86c123 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -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;
}