summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2016-08-20 03:57:32 +0000
committerAndrea Shepard <andrea@torproject.org>2016-08-20 03:57:32 +0000
commit3efe92ba58137022dd6c61cff9823813218a1a14 (patch)
tree74f4febb3370c643eeeda484c696335be2c3e329 /src/or/connection.c
parent1a7709d40949b559a6f86e2bbcd1648eeeeed1af (diff)
downloadtor-3efe92ba58137022dd6c61cff9823813218a1a14.tar.gz
tor-3efe92ba58137022dd6c61cff9823813218a1a14.zip
Consider the case that a connection doesn't have a valid socket during OOS
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 713a70cca4..6b85bfb550 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -4587,6 +4587,11 @@ pick_oos_victims, (int n))
tor_assert(c->type <= CONN_TYPE_MAX_);
++(conn_counts_by_type[c->type]);
+ /* Skip anything without a socket we can free */
+ if (!(SOCKET_OK(c->s))) {
+ continue;
+ }
+
/* Skip anything we would count as moribund */
if (connection_is_moribund(c)) {
continue;