diff options
author | David Goulet <dgoulet@torproject.org> | 2019-10-30 11:44:50 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-10-30 16:12:56 -0400 |
commit | cfc60e566cf4100400a8a411faccc9744c07cc8b (patch) | |
tree | 78e3673cd02ab7e39637a4f4e71caefcc3fb8ebd /src/core/or/circuitlist.c | |
parent | 183f9e490ff0aa5100567b1c753456904ca58a45 (diff) | |
download | tor-cfc60e566cf4100400a8a411faccc9744c07cc8b.tar.gz tor-cfc60e566cf4100400a8a411faccc9744c07cc8b.zip |
circ: Add an handle to circuit_t
Closes #32343
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core/or/circuitlist.c')
-rw-r--r-- | src/core/or/circuitlist.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/or/circuitlist.c b/src/core/or/circuitlist.c index 9ee9f93c99..9a0b9241da 100644 --- a/src/core/or/circuitlist.c +++ b/src/core/or/circuitlist.c @@ -147,6 +147,9 @@ static int any_opened_circs_cached_val = 0; /********* END VARIABLES ************/ +/* Implement circuit handle helpers. */ +HANDLE_IMPL(circuit, circuit_t,) + or_circuit_t * TO_OR_CIRCUIT(circuit_t *x) { @@ -1247,6 +1250,9 @@ circuit_free_(circuit_t *circ) /* Free any circuit padding structures */ circpad_circuit_free_all_machineinfos(circ); + /* Clear all dangling handle references. */ + circuit_handles_clear(circ); + if (should_free) { memwipe(mem, 0xAA, memlen); /* poison memory */ tor_free(mem); |