mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
[TELNETD]
Fix handle leaks svn path=/trunk/; revision=54709
This commit is contained in:
parent
0f0ba6a559
commit
a16e45a07d
1 changed files with 12 additions and 4 deletions
|
@ -359,7 +359,7 @@ static int ReceiveLine(int sock, char *buffer, int len, EchoMode echo)
|
|||
*/
|
||||
static void RunShell(client_t *client)
|
||||
{
|
||||
DWORD threadID;
|
||||
HANDLE threadHandle;
|
||||
HANDLE hChildStdinRd;
|
||||
HANDLE hChildStdinWr;
|
||||
HANDLE hChildStdoutRd;
|
||||
|
@ -432,9 +432,17 @@ static void RunShell(client_t *client)
|
|||
if (!CloseHandle(hChildStdinRd))
|
||||
ErrorExit("Closing handle failed");
|
||||
|
||||
CreateThread(NULL, 0, WriteToPipeThread, client, 0, &threadID);
|
||||
CreateThread(NULL, 0, ReadFromPipeThread, client, 0, &threadID);
|
||||
CreateThread(NULL, 0, MonitorChildThread, client, 0, &threadID);
|
||||
threadHandle = CreateThread(NULL, 0, WriteToPipeThread, client, 0, NULL);
|
||||
if (threadHandle != NULL)
|
||||
CloseHandle(threadHandle);
|
||||
|
||||
threadHandle = CreateThread(NULL, 0, ReadFromPipeThread, client, 0, NULL);
|
||||
if (threadHandle != NULL)
|
||||
CloseHandle(threadHandle);
|
||||
|
||||
threadHandle = CreateThread(NULL, 0, MonitorChildThread, client, 0, NULL);
|
||||
if (threadHandle != NULL)
|
||||
CloseHandle(threadHandle);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue