From ddc99f085fd6c54feaf4e41912bc8ab5903bdf8e Mon Sep 17 00:00:00 2001 From: dnobori Date: Mon, 7 Jun 2021 22:18:30 +0900 Subject: v4.36-9754-beta --- src/Cedar/Connection.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/Cedar/Connection.c') diff --git a/src/Cedar/Connection.c b/src/Cedar/Connection.c index 5bdb0a34..e7298ddd 100644 --- a/src/Cedar/Connection.c +++ b/src/Cedar/Connection.c @@ -1709,7 +1709,7 @@ void ConnectionReceive(CONNECTION *c, CANCEL *c1, CANCEL *c2) num = LIST_NUM(tcp->TcpSockList); if (num >= s->MaxConnection) { - TCPSOCK *ts; + TCPSOCK *ts = NULL; for (i = 0;i < num;i++) { ts = LIST_DATA(tcp->TcpSockList, i); @@ -1722,11 +1722,14 @@ void ConnectionReceive(CONNECTION *c, CANCEL *c1, CANCEL *c2) c2s++; } } - if (s2c == 0 || c2s == 0) + if (ts != NULL) { - // Disconnect the last socket - Disconnect(ts->Sock); - Debug("Disconnect (s2c=%u, c2s=%u)\n", s2c, c2s); + if (s2c == 0 || c2s == 0) + { + // Disconnect the last socket + Disconnect(ts->Sock); + Debug("Disconnect (s2c=%u, c2s=%u)\n", s2c, c2s); + } } } } -- cgit v1.2.3