Author: gadamopoulos Date: Mon Aug 21 09:07:41 2017 New Revision: 75633
URL: http://svn.reactos.org/svn/reactos?rev=75633&view=rev Log: [SHELL32] -CFSFolder: Fix a couple of handle leaks.
Modified: trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp
Modified: trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/C... ============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp [iso-8859-1] Mon Aug 21 09:07:41 2017 @@ -85,7 +85,9 @@
WCHAR wszCLSIDValue[CHARS_IN_GUID]; DWORD dwSize = sizeof(wszCLSIDValue); - if (RegGetValueW(hkeyProgId, NULL, NULL, RRF_RT_REG_SZ, NULL, wszCLSIDValue, &dwSize)) + LONG res = RegGetValueW(hkeyProgId, NULL, NULL, RRF_RT_REG_SZ, NULL, wszCLSIDValue, &dwSize); + RegCloseKey(hkeyProgId); + if (res) { ERR("OpenKeyFromFileType succeeded but RegGetValueW failed\n"); return S_FALSE; @@ -254,6 +256,9 @@ { initIcon->SetNormalIcon(swShell32Name, 0); } + + if (hkey) + RegCloseKey(hkey); }
return initIcon->QueryInterface(iid, ppvOut);