From ae4eafbeccbf03a2659cf9d9ccfab008340d2721 Mon Sep 17 00:00:00 2001 From: Thomas Weidenmueller Date: Mon, 5 Dec 2005 20:39:47 +0100 Subject: [PATCH] devenum: Don't leak key handle creating a category registry key. --- dlls/devenum/createdevenum.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/devenum/createdevenum.c b/dlls/devenum/createdevenum.c index 15948cfae66..416c238a33d 100644 --- a/dlls/devenum/createdevenum.c +++ b/dlls/devenum/createdevenum.c @@ -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);