aboutsummaryrefslogtreecommitdiff
path: root/src/core/mainloop
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-18 15:06:36 -0400
committerNick Mathewson <nickm@torproject.org>2018-10-14 15:25:16 -0400
commit965549aa07d94a9f9e510cdb7a215bf9a3ed7bb8 (patch)
tree4a8a4fa21a4fba053eade245a341c39ed9c29a1d /src/core/mainloop
parent7ace8d5a61f75fb77e3619deed417edd5610a4f1 (diff)
downloadtor-965549aa07d94a9f9e510cdb7a215bf9a3ed7bb8.tar.gz
tor-965549aa07d94a9f9e510cdb7a215bf9a3ed7bb8.zip
Use assertions so GCC LTO doesn't worry about TLS channel conversion
Part of #27772
Diffstat (limited to 'src/core/mainloop')
-rw-r--r--src/core/mainloop/connection.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index 0c3abc8442..7e2c4ce406 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -656,14 +656,15 @@ connection_free_minimal(connection_t *conn)
tor_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);
+ tor_assert(base_chan);
log_info(LD_CHANNEL,
"Freeing orconn at %p, saw channel %p with ID "
"%"PRIu64 " left un-NULLed",
- or_conn, TLS_CHAN_TO_BASE(or_conn->chan),
- (
- TLS_CHAN_TO_BASE(or_conn->chan)->global_identifier));
- if (!CHANNEL_FINISHED(TLS_CHAN_TO_BASE(or_conn->chan))) {
- channel_close_for_error(TLS_CHAN_TO_BASE(or_conn->chan));
+ or_conn, base_chan,
+ base_chan->global_identifier);
+ if (!CHANNEL_FINISHED(base_chan)) {
+ channel_close_for_error(base_chan);
}
or_conn->chan->conn = NULL;