[MKHIVE] Fix cases where 'rc' was used without being initialized.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Thu, 18 Oct 2018 21:07:41 +0000 (23:07 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Thu, 18 Oct 2018 21:11:55 +0000 (23:11 +0200)
Fixes crashes when the tool is compiled with Run-Time Checks enabled.
And thus should fix the MSVC buildbots!
Thanks to Pierre for having brought this issue to me.

CORE-15201

sdk/tools/mkhive/registry.c

index c188d7a..ad0aafc 100644 (file)
@@ -572,6 +572,7 @@ RegDeleteKeyW(
     else
     {
         hTargetKey = hKey;
     else
     {
         hTargetKey = hKey;
+        rc = ERROR_SUCCESS;
     }
 
     /* Don't allow deleting the root */
     }
 
     /* Don't allow deleting the root */
@@ -618,6 +619,8 @@ RegDeleteKeyW(
                 /* Release the cell */
                 HvReleaseCell(Hive, ParentCell);
             }
                 /* Release the cell */
                 HvReleaseCell(Hive, ParentCell);
             }
+
+            rc = ERROR_SUCCESS;
         }
         else
         {
         }
         else
         {