diff --git a/dll/win32/browseui/shellfind/CFindFolder.cpp b/dll/win32/browseui/shellfind/CFindFolder.cpp index 4db35f633b3..dcac0c0c60c 100644 --- a/dll/win32/browseui/shellfind/CFindFolder.cpp +++ b/dll/win32/browseui/shellfind/CFindFolder.cpp @@ -556,8 +556,10 @@ class CFindFolderContextMenu : CComHeapPtr folderPidl(ILCreateFromPathW(_ILGetPath(apidl[i]))); if (!folderPidl) return E_OUTOFMEMORY; - LPCITEMIDLIST pidl = _ILGetFSPidl(apidl[i]); - SHOpenFolderAndSelectItems(folderPidl, 1, &pidl, 0); + CComHeapPtr filePidl(ILCombine(folderPidl, _ILGetFSPidl(apidl[i]))); + if (!filePidl) + return E_OUTOFMEMORY; + SHOpenFolderAndSelectItems(folderPidl, 1, &filePidl, 0); } return S_OK; }