[ACPI] acpi_create_registry_table(): Close the key handle, on errors (#3372)

Addendum to 44f1cf1 (r74559). CORE-12942
This commit is contained in:
Serge Gautherie 2020-12-31 15:42:42 +01:00 committed by GitHub
parent 309ed0d1fe
commit 685f15e253
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -415,6 +415,7 @@ acpi_create_registry_table(HANDLE ParentKeyHandle, ACPI_TABLE_HEADER *OutTable,
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("RtlAnsiStringToUnicodeString() for %s failed (Status 0x%08lx)\n", HardwareKeyNameA, Status); DPRINT1("RtlAnsiStringToUnicodeString() for %s failed (Status 0x%08lx)\n", HardwareKeyNameA, Status);
ZwClose(KeyHandle);
return Status; return Status;
} }
@ -444,6 +445,7 @@ acpi_create_registry_table(HANDLE ParentKeyHandle, ACPI_TABLE_HEADER *OutTable,
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("RtlAnsiStringToUnicodeString() for %s failed (Status 0x%08lx)\n", HardwareKeyNameA, Status); DPRINT1("RtlAnsiStringToUnicodeString() for %s failed (Status 0x%08lx)\n", HardwareKeyNameA, Status);
ZwClose(KeyHandle);
return Status; return Status;
} }
@ -475,6 +477,7 @@ acpi_create_registry_table(HANDLE ParentKeyHandle, ACPI_TABLE_HEADER *OutTable,
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("RtlStringCbPrintfW() for 0x%08lx failed (Status 0x%08lx)\n", OutTable->OemRevision, Status); DPRINT1("RtlStringCbPrintfW() for 0x%08lx failed (Status 0x%08lx)\n", OutTable->OemRevision, Status);
ZwClose(KeyHandle);
return Status; return Status;
} }
RtlInitUnicodeString(&HardwareKeyName, OemRevision); RtlInitUnicodeString(&HardwareKeyName, OemRevision);