[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) 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) if(!msg)
return FALSE; return FALSE;
@ -120,22 +126,23 @@ GUIDisplayStatusMessage(
msg->pMessage = pMessage; msg->pMessage = pMessage;
msg->hDesktop = hDesktop; msg->hDesktop = hDesktop;
msg->StartupEvent = CreateEventW( msg->StartupEvent = CreateEventW(NULL,
NULL, TRUE,
TRUE, FALSE,
FALSE, NULL);
NULL);
if (!msg->StartupEvent) if (!msg->StartupEvent)
{
HeapFree(GetProcessHeap(), 0, msg);
return FALSE; return FALSE;
}
Thread = CreateThread( Thread = CreateThread(NULL,
NULL, 0,
0, StartupWindowThread,
StartupWindowThread, (PVOID)msg,
(PVOID)msg, 0,
0, &ThreadId);
&ThreadId);
if (Thread) if (Thread)
{ {
CloseHandle(Thread); CloseHandle(Thread);
@ -375,7 +382,7 @@ DoChangePassword(
if (!ConnectToLsa(pgContext)) if (!ConnectToLsa(pgContext))
{ {
ERR("ConnectToLsa() failed\n"); ERR("ConnectToLsa() failed\n");
return FALSE; goto done;
} }
/* Call the authentication package */ /* Call the authentication package */