diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-10-07 08:07:53 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-10-07 08:07:53 -0400 |
commit | e0e0ef713e96a196782fec754b11874675263c04 (patch) | |
tree | f8f6a1cb8c87d4f2eb2a26b8712c3447d08b9f16 /src/core | |
parent | 84a5bd48e2717f29b547d9fd43d83cab3da39aaa (diff) | |
parent | ea339227c27c03d7ced9e526d9e945708f432b22 (diff) | |
download | tor-e0e0ef713e96a196782fec754b11874675263c04.tar.gz tor-e0e0ef713e96a196782fec754b11874675263c04.zip |
Merge remote-tracking branch 'tor-gitlab/mr/137' into maint-0.3.5
Diffstat (limited to 'src/core')
-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 3595bba85c..dcd4ec492f 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -2923,7 +2923,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); |