mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 16:26:02 +00:00
[TELNETD]
Fix handle leak Fix memory leak svn path=/trunk/; revision=54708
This commit is contained in:
parent
8a5c8f4eac
commit
0f0ba6a559
1 changed files with 6 additions and 2 deletions
|
@ -137,14 +137,18 @@ static void WaitForConnect(void)
|
|||
/* Function: UserLogin */
|
||||
static void UserLogin(int client_socket)
|
||||
{
|
||||
DWORD threadID;
|
||||
HANDLE threadHandle;
|
||||
client_t *client = malloc(sizeof(client_t));
|
||||
|
||||
if (client == NULL)
|
||||
ErrorExit("failed to allocate memory for client");
|
||||
|
||||
client->socket = client_socket;
|
||||
CreateThread(NULL, 0, UserLoginThread, client, 0, &threadID);
|
||||
threadHandle = CreateThread(NULL, 0, UserLoginThread, client, 0, NULL);
|
||||
if (threadHandle == NULL)
|
||||
free(client);
|
||||
else
|
||||
CloseHandle(threadHandle);
|
||||
}
|
||||
|
||||
/* Function: UserLoginThread */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue