mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 06:52:07 +00:00
[WIN32K:NTUSER]
- Don't leak the captured string in NtUserThunkedMenuItemInfo CORE-10493 svn path=/trunk/; revision=69846
This commit is contained in:
parent
6d16a3e430
commit
b90b19966b
1 changed files with 7 additions and 2 deletions
|
@ -6216,13 +6216,13 @@ NtUserThunkedMenuItemInfo(
|
|||
/* lpszCaption may be NULL, check for it and call RtlInitUnicodeString()
|
||||
if bInsert == TRUE call UserInsertMenuItem() else UserSetMenuItemInfo() */
|
||||
|
||||
RtlInitEmptyUnicodeString(&lstrCaption, NULL, 0);
|
||||
|
||||
if (!(Menu = UserGetMenuObject(hMenu)))
|
||||
{
|
||||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
RtlInitUnicodeString(&lstrCaption, 0);
|
||||
|
||||
/* Check if we got a Caption */
|
||||
if (lpszCaption && lpszCaption->Buffer)
|
||||
{
|
||||
|
@ -6243,6 +6243,11 @@ NtUserThunkedMenuItemInfo(
|
|||
RETURN( UserMenuItemInfo(Menu, uItem, fByPosition, (PROSMENUITEMINFO)lpmii, TRUE, &lstrCaption));
|
||||
|
||||
CLEANUP:
|
||||
if (lstrCaption.Buffer)
|
||||
{
|
||||
ReleaseCapturedUnicodeString(&lstrCaption, UserMode);
|
||||
}
|
||||
|
||||
TRACE("Leave NtUserThunkedMenuItemInfo, ret=%i\n",_ret_);
|
||||
UserLeave();
|
||||
END_CLEANUP;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue