mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:45:42 +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 */
|
/* Function: UserLogin */
|
||||||
static void UserLogin(int client_socket)
|
static void UserLogin(int client_socket)
|
||||||
{
|
{
|
||||||
DWORD threadID;
|
HANDLE threadHandle;
|
||||||
client_t *client = malloc(sizeof(client_t));
|
client_t *client = malloc(sizeof(client_t));
|
||||||
|
|
||||||
if (client == NULL)
|
if (client == NULL)
|
||||||
ErrorExit("failed to allocate memory for client");
|
ErrorExit("failed to allocate memory for client");
|
||||||
|
|
||||||
client->socket = client_socket;
|
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 */
|
/* Function: UserLoginThread */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue