We need to set the new text even if the old text string was NULL.

oldstable
Huw Davies 2004-03-11 00:41:28 +00:00 committed by Alexandre Julliard
parent cf8a25f0d7
commit 30dc42912e
1 changed files with 4 additions and 3 deletions

View File

@ -4237,9 +4237,10 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu,
}
if (lpmii->fMask & MIIM_STRING ) {
/* free the string when used */
if (IS_STRING_ITEM(menu->fType) && menu->text) {
HeapFree(GetProcessHeap(), 0, menu->text);
if (IS_STRING_ITEM(menu->fType)) {
/* free the string when used */
if(menu->text)
HeapFree(GetProcessHeap(), 0, menu->text);
set_menu_item_text( menu, lpmii->dwTypeData, unicode );
}
}