aboutsummaryrefslogtreecommitdiffstats
path: root/libsysutils
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2011-01-21 19:25:51 +0100
committerDavid 'Digit' Turner <digit@google.com>2011-01-21 19:25:51 +0100
commitb913b5170f3b957d7d1ced425e891a4208ce88bc (patch)
treecf58bb53582b7253109a61f35dd45300418d0b71 /libsysutils
parentc1b546b22dc229fdbef9105f010e3ac0172cfc8f (diff)
downloadsystem_core-b913b5170f3b957d7d1ced425e891a4208ce88bc.tar.gz
system_core-b913b5170f3b957d7d1ced425e891a4208ce88bc.tar.bz2
system_core-b913b5170f3b957d7d1ced425e891a4208ce88bc.zip
libsysutils: Fix a file descriptor leak.
The recent refactoring of the select() loop in SocketListener missed a close() of the file descriptor when the onDataAvailable() callback returns false. Change-Id: I767caefab4b98ab350f2db2497ee2bd630f20850
Diffstat (limited to 'libsysutils')
-rw-r--r--libsysutils/src/SocketListener.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libsysutils/src/SocketListener.cpp b/libsysutils/src/SocketListener.cpp
index 677c57dc..611d5fe5 100644
--- a/libsysutils/src/SocketListener.cpp
+++ b/libsysutils/src/SocketListener.cpp
@@ -225,6 +225,7 @@ void SocketListener::runListener() {
}
pthread_mutex_unlock(&mClientsLock);
/* Destroy the client */
+ close(c->getSocket());
delete c;
}
}