mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 00:10:39 +00:00
Initialize variables and close keys only if they were opened, based on wine code. Fixes CIDs 787, 788.
svn path=/trunk/; revision=36815
This commit is contained in:
parent
edb9e011a3
commit
eb2c5f864c
1 changed files with 3 additions and 2 deletions
|
@ -299,7 +299,7 @@ static HRESULT register_clsids(int count, const register_info * pRegInfo, LPCWST
|
|||
{
|
||||
HRESULT res = S_OK;
|
||||
WCHAR dll_module[MAX_PATH];
|
||||
LPOLESTR clsidString;
|
||||
LPOLESTR clsidString = NULL;
|
||||
HKEY hkeyClsid;
|
||||
HKEY hkeySub;
|
||||
HKEY hkeyInproc32;
|
||||
|
@ -321,6 +321,7 @@ static HRESULT register_clsids(int count, const register_info * pRegInfo, LPCWST
|
|||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
hkeySub = 0;
|
||||
if (SUCCEEDED(res))
|
||||
{
|
||||
res = StringFromCLSID(pRegInfo[i].clsid, &clsidString);
|
||||
|
@ -361,7 +362,7 @@ static HRESULT register_clsids(int count, const register_info * pRegInfo, LPCWST
|
|||
(lstrlenW(pszThreadingModel) + 1) * sizeof(WCHAR));
|
||||
RegCloseKey(hkeyInproc32);
|
||||
}
|
||||
RegCloseKey(hkeySub);
|
||||
if (hkeySub) RegCloseKey(hkeySub);
|
||||
CoTaskMemFree(clsidString);
|
||||
clsidString = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue