mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 03:15:43 +00:00
[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:
parent
19f72d7cc5
commit
88985c5d99
1 changed files with 21 additions and 14 deletions
|
@ -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 */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue