[TELNETD]

Fix handle leak
Fix memory leak

svn path=/trunk/; revision=54708
This commit is contained in:
Pierre Schweitzer 2011-12-20 16:19:58 +00:00
parent 8a5c8f4eac
commit 0f0ba6a559

View file

@ -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 */