mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-27 03:43:36 +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:
@@ -674,6 +674,14 @@ User32EnumWindows(HDESK hDesktop,
|
||||
if (!NT_SUCCESS(Status))
|
||||
return FALSE;
|
||||
|
||||
if (!dwCount)
|
||||
{
|
||||
if (!dwThreadId)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* allocate buffer to receive HWND handles */
|
||||
hHeap = GetProcessHeap();
|
||||
pHwnd = HeapAlloc(hHeap, 0, sizeof(HWND)*(dwCount+1));
|
||||
@@ -698,14 +706,6 @@ User32EnumWindows(HDESK hDesktop,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dwCount)
|
||||
{
|
||||
if (!dwThreadId)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* call the user's callback function until we're done or
|
||||
they tell us to quit */
|
||||
for ( i = 0; i < dwCount; i++ )
|
||||
|
||||
Reference in New Issue
Block a user