]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Close fds to avoid fd leakage.
authorJulian Seward <jseward@acm.org>
Sun, 20 Jul 2003 22:39:58 +0000 (22:39 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 20 Jul 2003 22:39:58 +0000 (22:39 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1768

auxprogs/valgrind-listener.c

index 31c9cc336169e0928c6ae6946fd3e5983b48f30d..6d70c34ce0f432b9fc3861ca7ca0f188dad58060 100644 (file)
@@ -366,8 +366,9 @@ int main (int argc, char** argv)
  
             if (res == 0) {
                /* the connection has been closed. */
+               close(conn_pollfd[i].fd);
                /* this fd has been closed or otherwise gone bad; forget
-                about it. */
+                 about it. */
                for (k = 0; k < M_CONNECTIONS; k++)
                   if (conn_fd[k] == conn_pollfd[i].fd) 
                      break;