aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2012-11-21 16:33:16 -0800
committerMike Perry <mikeperry-git@fscked.org>2012-12-07 15:28:38 -0800
commit7a28862d56c15e4b83efc514621a330085781323 (patch)
treea9237c43bea221682d120c9e82f8faa2f3abbd85 /src
parent721f7e375114abfcb1a41ade58ac59ec79b8a3af (diff)
downloadtor-7a28862d56c15e4b83efc514621a330085781323.tar
tor-7a28862d56c15e4b83efc514621a330085781323.tar.gz
Fix another crash bug.
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index aaa195970..8304ad8b8 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1501,14 +1501,19 @@ pathbias_get_closed_count(entry_guard_t *guard)
/* Count currently open circuits. Give them the benefit of the doubt */
for ( ; circ; circ = circ->next) {
+ origin_circuit_t *ocirc = NULL;
if (!CIRCUIT_IS_ORIGIN(circ) || /* didn't originate here */
- circ->marked_for_close || /* already counted */
- !circ->cpath || !circ->cpath->extend_info)
+ circ->marked_for_close) /* already counted */
continue;
- if (TO_ORIGIN_CIRCUIT(circ)->path_state == PATH_STATE_SUCCEEDED &&
+ ocirc = TO_ORIGIN_CIRCUIT(circ);
+
+ if(!ocirc->cpath || !ocirc->cpath->extend_info)
+ continue;
+
+ if (ocirc->path_state == PATH_STATE_SUCCEEDED &&
(memcmp(guard->identity,
- TO_ORIGIN_CIRCUIT(circ)->cpath->extend_info->identity_digest,
+ ocirc->cpath->extend_info->identity_digest,
DIGEST_LEN)
== 0)) {
open_circuits++;