[WIN32K:NTUSER] Correctly delete menus in failure cases in MENU_GetSystemMenu. CORE-12180

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

View file

@ -5092,15 +5092,13 @@ PMENU FASTCALL MENU_GetSystemMenu(PWND Window, PMENU Popup)
if (!hNewMenu)
{
ERR("No Menu!!\n");
IntReleaseMenuObject(SysMenu);
UserDestroyMenu(hSysMenu);
IntDestroyMenuObject(SysMenu, FALSE);
return NULL;
}
Menu = UserGetMenuObject(hNewMenu);
if (!Menu)
{
IntReleaseMenuObject(SysMenu);
UserDestroyMenu(hSysMenu);
IntDestroyMenuObject(SysMenu, FALSE);
return NULL;
}