diff options
author | Alexander Færøy <ahf@torproject.org> | 2020-09-18 14:51:54 +0000 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2020-09-18 14:51:54 +0000 |
commit | 485990641ba765414a0e69ce7f2cc57f018c3bed (patch) | |
tree | d141c197377824f6893fea8e53c9b3932c346886 /src | |
parent | e8a4482335a1ed6b8238fc7114e3fdd3d7fa9028 (diff) | |
parent | ea339227c27c03d7ced9e526d9e945708f432b22 (diff) | |
download | tor-485990641ba765414a0e69ce7f2cc57f018c3bed.tar.gz tor-485990641ba765414a0e69ce7f2cc57f018c3bed.zip |
Merge remote-tracking branch 'tor-gitlab/mr/137'
Diffstat (limited to 'src')
-rw-r--r-- | src/core/mainloop/connection.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index 82886ccd0b..29ffdaaf4e 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -3224,7 +3224,14 @@ retry_all_listeners(smartlist_t *new_conns, int close_all_noncontrol) &skip, &addr_in_use); } - tor_assert(new_conn); + /* There are many reasons why we can't open a new listener port so in case + * we hit those, bail early so tor can stop. */ + if (!new_conn) { + log_warn(LD_NET, "Unable to create listener port: %s:%d", + fmt_addr(&r->new_port->addr), r->new_port->port); + retval = -1; + break; + } smartlist_add(new_conns, new_conn); |