devenum: Don't leak key handle creating a category registry key.
authorThomas Weidenmueller <wine-patches@reactsoft.com>
Mon, 5 Dec 2005 19:39:47 +0000 (20:39 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 5 Dec 2005 19:39:47 +0000 (20:39 +0100)
dlls/devenum/createdevenum.c

index 15948cfae6676f7b2b3506e146d886225480b0f7..416c238a33d10eb72f48e376234e1dd424105063 100644 (file)
@@ -202,8 +202,10 @@ static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID * clsidCategory)
         res = E_INVALIDARG;
 
     if (SUCCEEDED(res))
-        res = HRESULT_FROM_WIN32(
-            RegCreateKeyW(HKEY_CURRENT_USER, wszRegKey, &hkeyDummy));
+    {
+        LONG lRes = RegCreateKeyW(HKEY_CURRENT_USER, wszRegKey, &hkeyDummy);
+        res = HRESULT_FROM_WIN32(lRes);
+    }
 
     if (hkeyDummy)
         RegCloseKey(hkeyDummy);