aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 738119fa18..80bb7f69f3 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -943,10 +943,6 @@ circuit_free(circuit_t *circ)
crypto_cipher_free(ocirc->n_crypto);
crypto_digest_free(ocirc->n_digest);
- if (ocirc->hs_token) {
- hs_circuitmap_remove_circuit(ocirc);
- }
-
if (ocirc->rend_splice) {
or_circuit_t *other = ocirc->rend_splice;
tor_assert(other->base_.magic == OR_CIRCUIT_MAGIC);
@@ -978,6 +974,11 @@ circuit_free(circuit_t *circ)
/* Remove from map. */
circuit_set_n_circid_chan(circ, 0, NULL);
+ /* Clear HS circuitmap token from this circ (if any) */
+ if (circ->hs_token) {
+ hs_circuitmap_remove_circuit(circ);
+ }
+
/* Clear cell queue _after_ removing it from the map. Otherwise our
* "active" checks will be violated. */
cell_queue_clear(&circ->n_chan_cells);