Fix file descriptor leak on erroring client disconnects
- Client connections in error also need to be closed/freed - This fixes a file descriptor leak that would result in a bip crash Signed-off-by: Loïc Gomez <bip@animanova.fr>
This commit is contained in:
parent
d49f135370
commit
8f3b313776
@ -62,7 +62,7 @@ void connection_close(connection_t *cn)
|
||||
{
|
||||
mylog(LOG_DEBUG, "Connection close asked. FD:%d (status: %d)",
|
||||
(long)cn->handle, cn->connected);
|
||||
if (cn->connected != CONN_DISCONN && cn->connected != CONN_ERROR) {
|
||||
if (cn->connected != CONN_DISCONN) {
|
||||
cn->connected = CONN_DISCONN;
|
||||
if (close(cn->handle) == -1)
|
||||
mylog(LOG_WARN, "Error on socket close: %s",
|
||||
|
Loading…
Reference in New Issue
Block a user