diff options
| author | David 'Digit' Turner <digit@google.com> | 2011-01-21 19:25:51 +0100 |
|---|---|---|
| committer | David 'Digit' Turner <digit@google.com> | 2011-01-21 19:25:51 +0100 |
| commit | b913b5170f3b957d7d1ced425e891a4208ce88bc (patch) | |
| tree | cf58bb53582b7253109a61f35dd45300418d0b71 /libsysutils | |
| parent | c1b546b22dc229fdbef9105f010e3ac0172cfc8f (diff) | |
| download | system_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.cpp | 1 |
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; } } |
