aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2010-08-15 14:22:32 +0200
committerSebastian Hahn <sebastian@torproject.org>2010-08-16 00:33:29 +0200
commit70f0ba1495dce3b7c912354e2690fa9588b4e5b5 (patch)
tree5e254010f9bae2aa3414905dc52e47152f84dc6d /src
parent8d588e7b1a4fccffaa8318ed14d00a2ef615c53a (diff)
downloadtor-70f0ba1495dce3b7c912354e2690fa9588b4e5b5.tar
tor-70f0ba1495dce3b7c912354e2690fa9588b4e5b5.tar.gz
Fix a memory leak in circuit_build_times_parse_state
Thanks weasel for noticing.
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 5bb9d70d5..9749a56fe 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -692,7 +692,8 @@ circuit_build_times_parse_state(circuit_build_times_t *cbt,
"Corrupt state file? Build times count mismatch. "
"Read %d times, but file says %d", loaded_cnt,
state->TotalBuildTimes);
- *msg = tor_strdup("Build times count mismatch.");
+ if (!*msg)
+ *msg = tor_strdup("Build times count mismatch.");
circuit_build_times_reset(cbt);
tor_free(loaded_times);
return -1;
@@ -716,7 +717,8 @@ circuit_build_times_parse_state(circuit_build_times_t *cbt,
"Corrupt state file? Shuffled build times mismatch. "
"Read %d times, but file says %d", tot_values,
state->TotalBuildTimes);
- *msg = tor_strdup("Build times count mismatch.");
+ if (!*msg)
+ *msg = tor_strdup("Build times count mismatch.");
circuit_build_times_reset(cbt);
tor_free(loaded_times);
return -1;