mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 11:43:31 +00:00
gameux: Do not use RegCloseKey on invalid/uninitialized registry key handle (Coverity).
This commit is contained in:
parent
90415ebdfa
commit
46229acde9
1 changed files with 8 additions and 7 deletions
|
@ -388,17 +388,18 @@ static HRESULT GAMEUX_getAppIdFromGDFPath(
|
||||||
/* game is registered, let's read it's application id from registry */
|
/* game is registered, let's read it's application id from registry */
|
||||||
hr = GAMEUX_buildGameRegistryPath(installScope, &instanceId, &lpRegistryPath);
|
hr = GAMEUX_buildGameRegistryPath(installScope, &instanceId, &lpRegistryPath);
|
||||||
|
|
||||||
if(SUCCEEDED(hr))
|
if(SUCCEEDED(hr)) {
|
||||||
hr = HRESULT_FROM_WIN32(RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
hr = HRESULT_FROM_WIN32(RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||||
lpRegistryPath, 0, KEY_READ | KEY_WOW64_64KEY, &hKey));
|
lpRegistryPath, 0, KEY_READ | KEY_WOW64_64KEY, &hKey));
|
||||||
|
if(SUCCEEDED(hr)) {
|
||||||
if(SUCCEEDED(hr))
|
hr = HRESULT_FROM_WIN32(RegGetValueW(hKey,
|
||||||
hr = HRESULT_FROM_WIN32(RegGetValueW(hKey,
|
NULL, sApplicationId, RRF_RT_REG_SZ,
|
||||||
NULL, sApplicationId, RRF_RT_REG_SZ,
|
NULL, lpApplicationId, &dwLength));
|
||||||
NULL, lpApplicationId, &dwLength));
|
RegCloseKey(hKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpRegistryPath);
|
HeapFree(GetProcessHeap(), 0, lpRegistryPath);
|
||||||
RegCloseKey(hKey);
|
|
||||||
|
|
||||||
TRACE("found app id: %s, return: %#x\n", debugstr_w(lpApplicationId), hr);
|
TRACE("found app id: %s, return: %#x\n", debugstr_w(lpApplicationId), hr);
|
||||||
return hr;
|
return hr;
|
||||||
|
|
Loading…
Reference in a new issue