[SHELL32]

- Fix a use after free in COpenWithMenu::Initialize. Powered by DPH.

svn path=/trunk/; revision=65156
This commit is contained in:
Thomas Faber 2014-10-31 18:02:52 +00:00
parent e62a1d0299
commit 52f76a303d

View file

@ -1334,6 +1334,14 @@ COpenWithMenu::Initialize(LPCITEMIDLIST pidlFolder,
pidlFolder2 = (LPCITEMIDLIST) ((LPBYTE)pida + pida->aoffset[0]);
pidlChild = (LPCITEMIDLIST) ((LPBYTE)pida + pida->aoffset[1]);
if (!_ILIsValue(pidlChild))
{
TRACE("pidl is not a file\n");
GlobalUnlock(medium.hGlobal);
GlobalFree(medium.hGlobal);
return E_FAIL;
}
pidl = ILCombine(pidlFolder2, pidlChild);
GlobalUnlock(medium.hGlobal);
@ -1344,12 +1352,6 @@ COpenWithMenu::Initialize(LPCITEMIDLIST pidlFolder,
ERR("no mem\n");
return E_OUTOFMEMORY;
}
if (!_ILIsValue(pidlChild))
{
TRACE("pidl is not a file\n");
SHFree((void*)pidl);
return E_FAIL;
}
if (!SHGetPathFromIDListW(pidl, m_wszPath))
{