user32: Handle HeapReAlloc failure in RemoveMenu.
The array size is being decreased so failure is not critical here, but it can still happen, e.g. when DPH is in use. Signed-off-by: Thomas Faber <thomas.faber@reactos.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d186f681fb
commit
7ee4588c0a
|
@ -3989,14 +3989,16 @@ BOOL WINAPI RemoveMenu( HMENU hMenu, UINT nPos, UINT wFlags )
|
|||
}
|
||||
else
|
||||
{
|
||||
MENUITEM *new_items;
|
||||
while(nPos < menu->nItems)
|
||||
{
|
||||
*item = *(item+1);
|
||||
item++;
|
||||
nPos++;
|
||||
}
|
||||
menu->items = HeapReAlloc( GetProcessHeap(), 0, menu->items,
|
||||
menu->nItems * sizeof(MENUITEM) );
|
||||
new_items = HeapReAlloc( GetProcessHeap(), 0, menu->items,
|
||||
menu->nItems * sizeof(MENUITEM) );
|
||||
if (new_items) menu->items = new_items;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue