[WIN32K:NTUSER] Handle allocation failure in PopupMenuWndProc. CORE-14222
authorThomas Faber <thomas.faber@reactos.org>
Thu, 1 Feb 2018 10:06:03 +0000 (11:06 +0100)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 18 Feb 2018 10:27:27 +0000 (11:27 +0100)
win32ss/user/ntuser/menu.c

index 4de96e8..8432f3a 100644 (file)
@@ -4436,6 +4436,10 @@ PopupMenuWndProc(
         }
         Wnd->fnid = FNID_MENU;
         pPopupMenu = DesktopHeapAlloc( Wnd->head.rpdesk, sizeof(POPUPMENU) );
+        if (pPopupMenu == NULL)
+        {
+            return TRUE;
+        }
         pPopupMenu->posSelectedItem = NO_SELECTED_ITEM;
         pPopupMenu->spwndPopupMenu = Wnd;
         ((PMENUWND)Wnd)->ppopupmenu = pPopupMenu;