[MSGINA]: Fix a memory leak. Caught by mudhead.

CORE-7871 #resolve #comment Fixed in rev.62065, thanks.

svn path=/trunk/; revision=62065
This commit is contained in:
Hermès Bélusca-Maïto 2014-02-09 11:17:29 +00:00
parent 19f72d7cc5
commit 88985c5d99

View file

@ -110,7 +110,13 @@ GUIDisplayStatusMessage(
if (!pgContext->hStatusWindow)
{
msg = (PDISPLAYSTATUSMSG)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DISPLAYSTATUSMSG));
/*
* If everything goes correctly, 'msg' is freed
* by the 'StartupWindowThread' thread.
*/
msg = (PDISPLAYSTATUSMSG)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof(DISPLAYSTATUSMSG));
if(!msg)
return FALSE;
@ -120,22 +126,23 @@ GUIDisplayStatusMessage(
msg->pMessage = pMessage;
msg->hDesktop = hDesktop;
msg->StartupEvent = CreateEventW(
NULL,
TRUE,
FALSE,
NULL);
msg->StartupEvent = CreateEventW(NULL,
TRUE,
FALSE,
NULL);
if (!msg->StartupEvent)
{
HeapFree(GetProcessHeap(), 0, msg);
return FALSE;
}
Thread = CreateThread(
NULL,
0,
StartupWindowThread,
(PVOID)msg,
0,
&ThreadId);
Thread = CreateThread(NULL,
0,
StartupWindowThread,
(PVOID)msg,
0,
&ThreadId);
if (Thread)
{
CloseHandle(Thread);
@ -375,7 +382,7 @@ DoChangePassword(
if (!ConnectToLsa(pgContext))
{
ERR("ConnectToLsa() failed\n");
return FALSE;
goto done;
}
/* Call the authentication package */