mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:02:59 +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])));
|
CComHeapPtr<ITEMIDLIST> folderPidl(ILCreateFromPathW(_ILGetPath(apidl[i])));
|
||||||
if (!folderPidl)
|
if (!folderPidl)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
CComHeapPtr<ITEMIDLIST> filePidl(ILCombine(folderPidl, _ILGetFSPidl(apidl[i])));
|
LPCITEMIDLIST child = _ILGetFSPidl(apidl[i]);
|
||||||
if (!filePidl)
|
SHOpenFolderAndSelectItems(folderPidl, 1, &child, 0);
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
SHOpenFolderAndSelectItems(folderPidl, 1, &filePidl, 0);
|
|
||||||
}
|
}
|
||||||
|
LocalFree(apidl); // Yes, LocalFree
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue