Commit 75139a3e authored by Ge van Geldorp's avatar Ge van Geldorp Committed by Alexandre Julliard

Fix resource leak on error paths.

parent 4ebd2fc0
......@@ -1258,13 +1258,16 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
dwAttributes = SFGAO_FILESYSTEM;
hr = IShellFolder_GetAttributesOf(psfFolder, 1, &pidlLast, &dwAttributes);
if (FAILED(hr) || !(dwAttributes & SFGAO_FILESYSTEM)) return FALSE;
if (FAILED(hr) || !(dwAttributes & SFGAO_FILESYSTEM)) {
IShellFolder_Release(psfFolder);
return FALSE;
}
hr = IShellFolder_GetDisplayNameOf(psfFolder, pidlLast, SHGDN_FORPARSING, &strret);
IShellFolder_Release(psfFolder);
if (FAILED(hr)) return FALSE;
hr = StrRetToBufW(&strret, pidlLast, pszPath, MAX_PATH);
IShellFolder_Release(psfFolder);
TRACE_(shell)("-- %s, 0x%08lx\n",debugstr_w(pszPath), hr);
return SUCCEEDED(hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment