diff options
author | Andrea Shepard <andrea@torproject.org> | 2012-10-08 18:24:04 -0700 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2012-10-08 18:24:04 -0700 |
commit | 71ba517e0c557d0ae35af7a5f99c8756f336a416 (patch) | |
tree | 6f6d56902ac25049441d25df1ce4fd649ba77b2a /src/or/channeltls.c | |
parent | b1b33f15bed25b2dbbe1ddd3bc69fe18b2fb8ed4 (diff) | |
download | tor-71ba517e0c557d0ae35af7a5f99c8756f336a416.tar.gz tor-71ba517e0c557d0ae35af7a5f99c8756f336a416.zip |
Check return value from connection_or_connect() in channel_tls_connect()
It's possible for connection_or_connect() to fail and return NULL after it
sets tlschan->conn, so not checking leaves a channel hanging around in
CHANNEL_STATE_OPENING with a pointer to a freed or_connection_t forever.
Diffstat (limited to 'src/or/channeltls.c')
-rw-r--r-- | src/or/channeltls.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/channeltls.c b/src/or/channeltls.c index 8a1b5ebc9f..03792dd796 100644 --- a/src/or/channeltls.c +++ b/src/or/channeltls.c @@ -129,7 +129,7 @@ channel_tls_connect(const tor_addr_t *addr, uint16_t port, cell_ewma_get_tick(); /* Set up or_connection stuff */ - connection_or_connect(addr, port, id_digest, tlschan); + tlschan->conn = connection_or_connect(addr, port, id_digest, tlschan); /* connection_or_connect() will fill in tlschan->conn */ if (!(tlschan->conn)) { channel_change_state(chan, CHANNEL_STATE_ERROR); |