[WIN32K:NTUSER] Handle IntCloneMenu failure in MENU_GetSystemMenu. CORE-12180

This commit is contained in:
Thomas Faber 2018-03-03 08:19:13 +01:00
parent ede8794c4b
commit 89217e3df5
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -5120,6 +5120,12 @@ PMENU FASTCALL MENU_GetSystemMenu(PWND Window, PMENU Popup)
IntMenuItemInfo(Menu, SC_MINIMIZE, FALSE, &ItemInfoSet, TRUE, NULL);
NewMenu = IntCloneMenu(Menu);
if (NewMenu == NULL)
{
IntDestroyMenuObject(Menu, FALSE);
IntDestroyMenuObject(SysMenu, FALSE);
return NULL;
}
IntReleaseMenuObject(NewMenu);
UserSetMenuDefaultItem(NewMenu, SC_CLOSE, FALSE);