Commit 7ee4588c authored by Thomas Faber's avatar Thomas Faber Committed by Alexandre Julliard

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: 's avatarThomas Faber <thomas.faber@reactos.org> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d186f681
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment