]> The Tcpdump Group git mirrors - libpcap/commitdiff
Don't leak thread handles.
authorGuy Harris <[email protected]>
Fri, 10 Nov 2017 21:13:10 +0000 (13:13 -0800)
committerGuy Harris <[email protected]>
Fri, 10 Nov 2017 21:13:10 +0000 (13:13 -0800)
These threads just run in the background; we don't need to wait for them
to finish, so close the handle as soon as we've gotten it.

rpcapd/rpcapd.c

index 8a4924ec32d03d1c943f475a6743fd4e50064c4e..0f0f5805bda8c084a702c53b19313796d797afcb 100755 (executable)
@@ -336,6 +336,7 @@ void main_startup(void)
                        SOCK_ASSERT("Error creating the active child threads", 1);
                        continue;
                }
+               CloseHandle(threadId);
 #else
                if ((pid = fork()) == 0)        // I am the child
                {
@@ -399,6 +400,7 @@ void main_startup(void)
                                SOCK_ASSERT("Error creating the passive child thread", 1);
                                continue;
                        }
+                       CloseHandle(threadId);
 #else
                        if ((pid = fork()) == 0)        // I am the child
                        {
@@ -597,6 +599,7 @@ main_passive(void *ptr)
                        sock_close(sockctrl, NULL, 0);
                        continue;
                }
+               CloseHandle(threadId);
 #else
                if ((pid = fork()) == 0)        // I am the child
                {