summaryrefslogtreecommitdiffstats
path: root/libsysutils/src
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2011-01-21 19:25:51 +0100
committerBrad Fitzpatrick <bradfitz@android.com>2011-03-22 14:03:04 -0700
commit15d09854a8b2a1adf2fa5123ff77b9882afd6c22 (patch)
treee92a2055b7ba3bb83da13edec0568417eb2b8d6d /libsysutils/src
parent100c0e2dab243da3a5351f1acbcdc560af10a405 (diff)
downloadsystem_core-15d09854a8b2a1adf2fa5123ff77b9882afd6c22.zip
system_core-15d09854a8b2a1adf2fa5123ff77b9882afd6c22.tar.gz
system_core-15d09854a8b2a1adf2fa5123ff77b9882afd6c22.tar.bz2
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/src')
-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 677c57d..611d5fe 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;
}
}