diff options
author | George Kadianakis <desnacked@riseup.net> | 2021-02-09 18:50:20 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2021-02-09 19:15:49 +0200 |
commit | b64fe4bf55e57c19bb0ade5fc08d6500ac561019 (patch) | |
tree | 9382a0c1c99aba69fcb99fdb151a90b3e131203f /src/core/or/circuituse.c | |
parent | 14e1c2fe0a5b94cfc2db9be0185a3b09fd119e3c (diff) | |
download | tor-b64fe4bf55e57c19bb0ade5fc08d6500ac561019.tar.gz tor-b64fe4bf55e57c19bb0ade5fc08d6500ac561019.zip |
Fix coverity warnings 1472846 / 1472845.
Diffstat (limited to 'src/core/or/circuituse.c')
-rw-r--r-- | src/core/or/circuituse.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c index 018654769d..11ba059b0e 100644 --- a/src/core/or/circuituse.c +++ b/src/core/or/circuituse.c @@ -2735,10 +2735,12 @@ consider_recording_trackhost(const entry_connection_t *conn, char fp[HEX_DIGEST_LEN+1]; uint64_t stream_id = 0; - if (conn) { - stream_id = ENTRY_TO_CONN(conn)->global_identifier; + if (BUG(!conn)) { + return; } + stream_id = ENTRY_TO_CONN(conn)->global_identifier; + /* Search the addressmap for this conn's destination. */ /* If they're not in the address map.. */ if (!options->TrackHostExits || @@ -2801,8 +2803,9 @@ connection_ap_handshake_attach_chosen_circuit(entry_connection_t *conn, tor_assert(conn->socks_request); if (conn->socks_request->command == SOCKS_COMMAND_CONNECT) { - if (!conn->use_begindir) + if (!conn->use_begindir) { consider_recording_trackhost(conn, circ); + } if (connection_ap_handshake_send_begin(conn) < 0) return -1; } else { |