Release shell folders only if they were successfully acquired.

This commit is contained in:
Michael Jung 2005-07-18 13:13:05 +00:00 committed by Alexandre Julliard
parent 324267c4a9
commit ff23dd29be
1 changed files with 2 additions and 2 deletions

View File

@ -404,10 +404,10 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
(LPVOID*)&psfFolder); (LPVOID*)&psfFolder);
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
hr = IShellFolder_GetAttributesOf(psfFolder, 0, NULL, pdwAttributes); hr = IShellFolder_GetAttributesOf(psfFolder, 0, NULL, pdwAttributes);
IShellFolder_Release(psfFolder);
} }
IShellFolder_Release(psfDesktop);
} }
IShellFolder_Release(psfFolder);
IShellFolder_Release(psfDesktop);
if (FAILED(hr)) return FALSE; if (FAILED(hr)) return FALSE;
} else { } else {
lResult = RegQueryValueExW(hSFKey, wszAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen); lResult = RegQueryValueExW(hSFKey, wszAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen);