summaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-04-09 20:09:26 +0000
committerNick Mathewson <nickm@torproject.org>2007-04-09 20:09:26 +0000
commiteb95ff9ba9894d6bf2c33ed69d4be88fa5567e77 (patch)
tree59db013c4e9ff5d589dc547957cefa5622d92d1a /src/or/circuitlist.c
parentf36c613dbc5f9326eea1626eaee63aa64e96f58e (diff)
downloadtor-eb95ff9ba9894d6bf2c33ed69d4be88fa5567e77.tar.gz
tor-eb95ff9ba9894d6bf2c33ed69d4be88fa5567e77.zip
r12317@catbus: nickm | 2007-04-09 15:50:51 -0400
Fix second part of bug 411 (which was actually a separate bug): it isnt safe to clear a cell queue while the circuit is active. svn:r9928
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index d9da7a9728..a0aa27c7d1 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -398,19 +398,23 @@ circuit_free(circuit_t *circ)
other->rend_splice = NULL;
}
- cell_queue_clear(&ocirc->p_conn_cells);
-
tor_free(circ->onionskin);
/* remove from map. */
circuit_set_p_circid_orconn(ocirc, 0, NULL);
- }
- cell_queue_clear(&circ->n_conn_cells);
+ /* Clear cell queue _after_ removing it from the map. Otherwise our
+ * "active" checks will be violated. */
+ cell_queue_clear(&ocirc->p_conn_cells);
+ }
/* Remove from map. */
circuit_set_n_circid_orconn(circ, 0, NULL);
+ /* Clear cell queue _after_ removing it from the map. Otherwise our
+ * "active" checks will be violated. */
+ cell_queue_clear(&circ->n_conn_cells);
+
memset(circ, 0xAA, sizeof(circuit_t)); /* poison memory */
tor_free(mem);
}