diff options
author | David 'Digit' Turner <digit@google.com> | 2011-01-21 19:25:51 +0100 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@android.com> | 2011-03-22 14:03:04 -0700 |
commit | 15d09854a8b2a1adf2fa5123ff77b9882afd6c22 (patch) | |
tree | e92a2055b7ba3bb83da13edec0568417eb2b8d6d /libsysutils/src | |
parent | 100c0e2dab243da3a5351f1acbcdc560af10a405 (diff) | |
download | system_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.cpp | 1 |
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; } } |