aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-03-12 10:57:08 -0400
committerNick Mathewson <nickm@torproject.org>2014-03-14 11:58:34 -0400
commitd769cab3e50979807a526b3ebc5c341c13b12e97 (patch)
treed523e22c1d43b360c22d92474b603a5b85147767
parent1a74360c2dd5c197e2dfc28b37961c77bb7792f1 (diff)
downloadtor-d769cab3e50979807a526b3ebc5c341c13b12e97.tar
tor-d769cab3e50979807a526b3ebc5c341c13b12e97.tar.gz
Defensive programming: null [pn]_chan,circ_id in circuit_mark_for_close_
Doing this as part of the patch for #9683 to prevent possible bugs down the line
-rw-r--r--src/or/circuitlist.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 0015a680c..867a9cd0a 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1594,6 +1594,7 @@ circuit_mark_for_close_, (circuit_t *circ, int reason, int line,
channel_send_destroy(circ->n_circ_id, circ->n_chan, reason);
}
circuitmux_detach_circuit(circ->n_chan->cmux, circ);
+ circuit_set_n_circid_chan(circ, 0, NULL);
}
if (! CIRCUIT_IS_ORIGIN(circ)) {
@@ -1627,6 +1628,7 @@ circuit_mark_for_close_, (circuit_t *circ, int reason, int line,
channel_send_destroy(or_circ->p_circ_id, or_circ->p_chan, reason);
}
circuitmux_detach_circuit(or_circ->p_chan->cmux, circ);
+ circuit_set_p_circid_chan(or_circ, 0, NULL);
}
} else {
origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);