Commit b64fe4bf authored by George Kadianakis's avatar George Kadianakis
Browse files

Fix coverity warnings 1472846 / 1472845.

parent 14e1c2fe
...@@ -2735,10 +2735,12 @@ consider_recording_trackhost(const entry_connection_t *conn, ...@@ -2735,10 +2735,12 @@ consider_recording_trackhost(const entry_connection_t *conn,
char fp[HEX_DIGEST_LEN+1]; char fp[HEX_DIGEST_LEN+1];
uint64_t stream_id = 0; uint64_t stream_id = 0;
if (conn) { if (BUG(!conn)) {
stream_id = ENTRY_TO_CONN(conn)->global_identifier; return;
} }
stream_id = ENTRY_TO_CONN(conn)->global_identifier;
/* Search the addressmap for this conn's destination. */ /* Search the addressmap for this conn's destination. */
/* If they're not in the address map.. */ /* If they're not in the address map.. */
if (!options->TrackHostExits || if (!options->TrackHostExits ||
...@@ -2801,8 +2803,9 @@ connection_ap_handshake_attach_chosen_circuit(entry_connection_t *conn, ...@@ -2801,8 +2803,9 @@ connection_ap_handshake_attach_chosen_circuit(entry_connection_t *conn,
tor_assert(conn->socks_request); tor_assert(conn->socks_request);
if (conn->socks_request->command == SOCKS_COMMAND_CONNECT) { if (conn->socks_request->command == SOCKS_COMMAND_CONNECT) {
if (!conn->use_begindir) if (!conn->use_begindir) {
consider_recording_trackhost(conn, circ); consider_recording_trackhost(conn, circ);
}
if (connection_ap_handshake_send_begin(conn) < 0) if (connection_ap_handshake_send_begin(conn) < 0)
return -1; return -1;
} else { } else {
......
...@@ -3521,10 +3521,12 @@ tell_controller_about_resolved_result(entry_connection_t *conn, ...@@ -3521,10 +3521,12 @@ tell_controller_about_resolved_result(entry_connection_t *conn,
{ {
uint64_t stream_id = 0; uint64_t stream_id = 0;
if (conn) { if (BUG(!conn)) {
stream_id = ENTRY_TO_CONN(conn)->global_identifier; return;
} }
stream_id = ENTRY_TO_CONN(conn)->global_identifier;
expires = time(NULL) + ttl; expires = time(NULL) + ttl;
if (answer_type == RESOLVED_TYPE_IPV4 && answer_len >= 4) { if (answer_type == RESOLVED_TYPE_IPV4 && answer_len >= 4) {
char *cp = tor_dup_ip(ntohl(get_uint32(answer))); char *cp = tor_dup_ip(ntohl(get_uint32(answer)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment