mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
When freeing a guard state, cancel it if its state is unknown
We don't want a guard to stay "pending" forever if the circuit_guard_state_t for it is freed before it succeeds or fails.
This commit is contained in:
parent
897626953b
commit
f71be74340
@ -885,6 +885,11 @@ circuit_free(circuit_t *circ)
|
||||
cpath_ref_decref(ocirc->build_state->service_pending_final_cpath_ref);
|
||||
}
|
||||
tor_free(ocirc->build_state);
|
||||
|
||||
/* Cancel before freeing, if we haven't already succeeded or failed. */
|
||||
if (ocirc->guard_state) {
|
||||
entry_guard_cancel(get_guard_selection_info(), ô->guard_state);
|
||||
}
|
||||
circuit_guard_state_free(ocirc->guard_state);
|
||||
|
||||
circuit_clear_cpath(ocirc);
|
||||
|
@ -634,6 +634,10 @@ connection_free_(connection_t *conn)
|
||||
|
||||
cached_dir_decref(dir_conn->cached_dir);
|
||||
rend_data_free(dir_conn->rend_data);
|
||||
if (dir_conn->guard_state) {
|
||||
/* Cancel before freeing, if it's still there. */
|
||||
entry_guard_cancel(get_guard_selection_info(), &dir_conn->guard_state);
|
||||
}
|
||||
circuit_guard_state_free(dir_conn->guard_state);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user