Author: gschneider
Date: Sat Oct 18 16:38:25 2008
New Revision: 36815
URL:
http://svn.reactos.org/svn/reactos?rev=36815&view=rev
Log:
Initialize variables and close keys only if they were opened, based on wine code. Fixes
CIDs 787, 788.
Modified:
trunk/reactos/dll/directx/devenum/devenum_main.c
Modified: trunk/reactos/dll/directx/devenum/devenum_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/devenum/devenu…
==============================================================================
--- trunk/reactos/dll/directx/devenum/devenum_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/devenum/devenum_main.c [iso-8859-1] Sat Oct 18 16:38:25
2008
@@ -299,7 +299,7 @@
{
HRESULT res = S_OK;
WCHAR dll_module[MAX_PATH];
- LPOLESTR clsidString;
+ LPOLESTR clsidString = NULL;
HKEY hkeyClsid;
HKEY hkeySub;
HKEY hkeyInproc32;
@@ -321,6 +321,7 @@
for (i = 0; i < count; i++)
{
+ hkeySub = 0;
if (SUCCEEDED(res))
{
res = StringFromCLSID(pRegInfo[i].clsid, &clsidString);
@@ -361,7 +362,7 @@
(lstrlenW(pszThreadingModel) + 1) * sizeof(WCHAR));
RegCloseKey(hkeyInproc32);
}
- RegCloseKey(hkeySub);
+ if (hkeySub) RegCloseKey(hkeySub);
CoTaskMemFree(clsidString);
clsidString = NULL;
}