https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d54e50f3dcfd89604504cdebb072c6be6d5b1a78

commit d54e50f3dcfd89604504cdebb072c6be6d5b1a78
Author:     Kyle Katarn <[email protected]>
AuthorDate: Tue Sep 8 21:55:45 2020 +0200
Commit:     GitHub <[email protected]>
CommitDate: Tue Sep 8 21:55:45 2020 +0200

    [EXPLORER] Registry key not closed on error (#3136)
    
    CORE-14519
---
 base/shell/explorer/shellservice.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/base/shell/explorer/shellservice.cpp 
b/base/shell/explorer/shellservice.cpp
index 2aded3050a0..459e9084cef 100644
--- a/base/shell/explorer/shellservice.cpp
+++ b/base/shell/explorer/shellservice.cpp
@@ -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;

Reply via email to