diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-08-03 10:15:08 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-08-03 10:15:08 -0400 |
commit | ea876ab00e223b0c1ba022cc27861cfbbde31b64 (patch) | |
tree | 9d47efd261683f70aa18a1ea7098dfe2d666476d /src | |
parent | 5b9508c9a5d757223c62749c51eaf7453ff26691 (diff) | |
download | tor-ea876ab00e223b0c1ba022cc27861cfbbde31b64.tar.gz tor-ea876ab00e223b0c1ba022cc27861cfbbde31b64.zip |
Wipe address strings from connections before freeing them them.
This is a defense-in-depth fix; closes 6198.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/mainloop/connection.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index 3595bba85c..4b321fe72f 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -637,7 +637,7 @@ connection_free_minimal(connection_t *conn) } } - tor_free(conn->address); + tor_str_wipe_and_free(conn->address); if (connection_speaks_cells(conn)) { or_connection_t *or_conn = TO_OR_CONN(conn); @@ -657,7 +657,7 @@ connection_free_minimal(connection_t *conn) } or_handshake_state_free(or_conn->handshake_state); or_conn->handshake_state = NULL; - tor_free(or_conn->nickname); + tor_str_wipe_and_free(or_conn->nickname); if (or_conn->chan) { /* Owww, this shouldn't happen, but... */ channel_t *base_chan = TLS_CHAN_TO_BASE(or_conn->chan); @@ -677,8 +677,8 @@ connection_free_minimal(connection_t *conn) } if (conn->type == CONN_TYPE_AP) { entry_connection_t *entry_conn = TO_ENTRY_CONN(conn); - tor_free(entry_conn->chosen_exit_name); - tor_free(entry_conn->original_dest_address); + tor_str_wipe_and_free(entry_conn->chosen_exit_name); + tor_str_wipe_and_free(entry_conn->original_dest_address); if (entry_conn->socks_request) socks_request_free(entry_conn->socks_request); if (entry_conn->pending_optimistic_data) { |