mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 09:03:25 +00:00
[USER32]
- Avoid a memory leak in User32EnumWindows in case the window count is zero. CORE-13194 svn path=/trunk/; revision=74497
This commit is contained in:
parent
ba1fcb6554
commit
0db63068ac
1 changed files with 8 additions and 8 deletions
|
@ -674,6 +674,14 @@ User32EnumWindows(HDESK hDesktop,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (!dwCount)
|
||||||
|
{
|
||||||
|
if (!dwThreadId)
|
||||||
|
return FALSE;
|
||||||
|
else
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* allocate buffer to receive HWND handles */
|
/* allocate buffer to receive HWND handles */
|
||||||
hHeap = GetProcessHeap();
|
hHeap = GetProcessHeap();
|
||||||
pHwnd = HeapAlloc(hHeap, 0, sizeof(HWND)*(dwCount+1));
|
pHwnd = HeapAlloc(hHeap, 0, sizeof(HWND)*(dwCount+1));
|
||||||
|
@ -698,14 +706,6 @@ User32EnumWindows(HDESK hDesktop,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dwCount)
|
|
||||||
{
|
|
||||||
if (!dwThreadId)
|
|
||||||
return FALSE;
|
|
||||||
else
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* call the user's callback function until we're done or
|
/* call the user's callback function until we're done or
|
||||||
they tell us to quit */
|
they tell us to quit */
|
||||||
for ( i = 0; i < dwCount; i++ )
|
for ( i = 0; i < dwCount; i++ )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue