aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-12-14 18:55:17 +0000
committerNick Mathewson <nickm@torproject.org>2005-12-14 18:55:17 +0000
commit7e632a75645c22efe7b1f122816e63839b119f8d (patch)
treeb38888c89510db1e1902e2751ff390dbc9cd8401 /src/or/circuitlist.c
parent4f3867032853f449c6f9241b016379cf84f3a269 (diff)
downloadtor-7e632a75645c22efe7b1f122816e63839b119f8d.tar
tor-7e632a75645c22efe7b1f122816e63839b119f8d.tar.gz
another possible patch related to circuit_free and memory stomping.
svn:r5580
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 6fc97f1e1..43a55493f 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -280,6 +280,7 @@ circuit_free(circuit_t *circ)
tor_free(circ->onionskin);
circuit_free_cpath(circ->cpath);
if (circ->rend_splice) {
+ tor_assert(circ->rend_splice->magic == CIRCUIT_MAGIC);
circ->rend_splice->rend_splice = NULL;
}
/* Remove from map. */
@@ -715,9 +716,11 @@ _circuit_mark_for_close(circuit_t *circ, int line, const char *file)
circ->marked_for_close = line;
circ->marked_for_close_file = file;
- if (circ->rend_splice && !circ->rend_splice->marked_for_close) {
- /* do this after marking this circuit, to avoid infinite recursion. */
- circuit_mark_for_close(circ->rend_splice);
+ if (circ->rend_splice) {
+ if (!circ->rend_splice->marked_for_close) {
+ /* do this after marking this circuit, to avoid infinite recursion. */
+ circuit_mark_for_close(circ->rend_splice);
+ }
circ->rend_splice = NULL;
}
}