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

commit 685f15e253a236d70840d1f5cfa8985206d006fc
Author:     Serge Gautherie <[email protected]>
AuthorDate: Thu Dec 31 15:42:42 2020 +0100
Commit:     GitHub <[email protected]>
CommitDate: Thu Dec 31 17:42:42 2020 +0300

    [ACPI] acpi_create_registry_table(): Close the key handle, on errors (#3372)
    
    Addendum to 44f1cf1 (r74559). CORE-12942
---
 drivers/bus/acpi/busmgr/utils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bus/acpi/busmgr/utils.c b/drivers/bus/acpi/busmgr/utils.c
index dfe216461ab..fc41f34fdb5 100644
--- a/drivers/bus/acpi/busmgr/utils.c
+++ b/drivers/bus/acpi/busmgr/utils.c
@@ -415,6 +415,7 @@ acpi_create_registry_table(HANDLE ParentKeyHandle, 
ACPI_TABLE_HEADER *OutTable,
         if (!NT_SUCCESS(Status))
         {
             DPRINT1("RtlAnsiStringToUnicodeString() for %s failed (Status 
0x%08lx)\n", HardwareKeyNameA, Status);
+            ZwClose(KeyHandle);
             return Status;
         }
 
@@ -444,6 +445,7 @@ acpi_create_registry_table(HANDLE ParentKeyHandle, 
ACPI_TABLE_HEADER *OutTable,
         if (!NT_SUCCESS(Status))
         {
             DPRINT1("RtlAnsiStringToUnicodeString() for %s failed (Status 
0x%08lx)\n", HardwareKeyNameA, Status);
+            ZwClose(KeyHandle);
             return Status;
         }
 
@@ -475,6 +477,7 @@ acpi_create_registry_table(HANDLE ParentKeyHandle, 
ACPI_TABLE_HEADER *OutTable,
         if (!NT_SUCCESS(Status))
         {
             DPRINT1("RtlStringCbPrintfW() for 0x%08lx failed (Status 
0x%08lx)\n", OutTable->OemRevision, Status);
+            ZwClose(KeyHandle);
             return Status;
         }
         RtlInitUnicodeString(&HardwareKeyName, OemRevision);

Reply via email to