mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 04:03:56 +00:00
[WIN32K:NTUSER] Handle realloc failure in IntRemoveMenuItem. CORE-14222
This commit is contained in:
parent
c464f4f2e3
commit
de455c4d50
1 changed files with 12 additions and 7 deletions
|
@ -598,6 +598,7 @@ BOOL FASTCALL
|
|||
IntRemoveMenuItem( PMENU pMenu, UINT nPos, UINT wFlags, BOOL bRecurse )
|
||||
{
|
||||
PITEM item;
|
||||
PITEM newItems;
|
||||
|
||||
TRACE("(menu=%p pos=%04x flags=%04x)\n",pMenu, nPos, wFlags);
|
||||
if (!(item = MENU_FindItem( &pMenu, &nPos, wFlags ))) return FALSE;
|
||||
|
@ -623,7 +624,11 @@ IntRemoveMenuItem( PMENU pMenu, UINT nPos, UINT wFlags, BOOL bRecurse )
|
|||
item++;
|
||||
nPos++;
|
||||
}
|
||||
pMenu->rgItems = DesktopHeapReAlloc(pMenu->head.rpdesk, pMenu->rgItems, pMenu->cItems * sizeof(ITEM));
|
||||
newItems = DesktopHeapReAlloc(pMenu->head.rpdesk, pMenu->rgItems, pMenu->cItems * sizeof(ITEM));
|
||||
if (newItems)
|
||||
{
|
||||
pMenu->rgItems = newItems;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue