Release shell folders only if they were successfully acquired.
This commit is contained in:
parent
324267c4a9
commit
ff23dd29be
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue