mirror of
https://github.com/reactos/reactos.git
synced 2025-02-20 15:35:04 +00:00
[BROWSEUI] Don't call SHOpenFolderAndSelectItems with full pidls and don't leak them (#6153)
- The children passed to SHOpenFolderAndSelectItems are not supposed to be full pidls. - Don't leak the array from IShellFolderView::GetSelectedObjects.
This commit is contained in:
parent
7ffc31554d
commit
5be53f553c
1 changed files with 3 additions and 4 deletions
|
@ -809,11 +809,10 @@ class CFindFolderContextMenu :
|
|||
CComHeapPtr<ITEMIDLIST> folderPidl(ILCreateFromPathW(_ILGetPath(apidl[i])));
|
||||
if (!folderPidl)
|
||||
return E_OUTOFMEMORY;
|
||||
CComHeapPtr<ITEMIDLIST> filePidl(ILCombine(folderPidl, _ILGetFSPidl(apidl[i])));
|
||||
if (!filePidl)
|
||||
return E_OUTOFMEMORY;
|
||||
SHOpenFolderAndSelectItems(folderPidl, 1, &filePidl, 0);
|
||||
LPCITEMIDLIST child = _ILGetFSPidl(apidl[i]);
|
||||
SHOpenFolderAndSelectItems(folderPidl, 1, &child, 0);
|
||||
}
|
||||
LocalFree(apidl); // Yes, LocalFree
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue