[EXPLORER] Registry key not closed on error (#3136)
authorKyle Katarn <contact@kcsoftwares.com>
Tue, 8 Sep 2020 19:55:45 +0000 (21:55 +0200)
committerGitHub <noreply@github.com>
Tue, 8 Sep 2020 19:55:45 +0000 (21:55 +0200)
CORE-14519

base/shell/explorer/shellservice.cpp

index 2aded30..459e908 100644 (file)
@@ -115,17 +115,18 @@ HRESULT InitShellServices(HDPA * phdpa)
         goto cleanup;
     }
 
-    RegCloseKey(hkey);
-
     /* Initialize */
     DPA_EnumCallback(hdpa, InitializeAllCallback, &hr);
     if (FAILED_UNEXPECTEDLY(hr))
         goto cleanup;
 
+    RegCloseKey(hkey);
+
     *phdpa = hdpa;
     return count > 0 ? S_OK : S_FALSE;
 
 cleanup:
+    RegCloseKey(hkey);
     *phdpa = NULL;
     ShutdownShellServices(hdpa);
     return hr;