[SHELL32] CGuidItemContextMenu: Fix pwszCLSID leak (#6607)

Fix memory leak.
JIRA issue: CORE-19478
- Use CoTaskMemFree for pwszCLSID to avoid memory leak
  in CGuidItemContextMenu_CreateInstance function.
This commit is contained in:
Katayama Hirofumi MZ 2024-03-12 16:10:59 +09:00 committed by GitHub
parent 5aaead3fdb
commit 88e1675ace
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -116,6 +116,7 @@ HRESULT CGuidItemContextMenu_CreateInstance(PCIDLIST_ABSOLUTE pidlFolder,
{
wcscpy(&key[6], pwszCLSID);
AddClassKeyToArray(key, hKeys, &cKeys);
CoTaskMemFree(pwszCLSID);
}
}
AddClassKeyToArray(L"Folder", hKeys, &cKeys);