From d040cc810ff98ccb9d552bf5ecbd119e657998cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 6 Mar 2026 14:46:51 +0800 Subject: [PATCH] SMBIOS (Windows): fixes issues raised by Copilot --- src/common/impl/smbiosHelper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/impl/smbiosHelper.c b/src/common/impl/smbiosHelper.c index 0e58535bb..2e7af8dd5 100644 --- a/src/common/impl/smbiosHelper.c +++ b/src/common/impl/smbiosHelper.c @@ -109,7 +109,7 @@ typedef struct FFSmbios20EntryPoint uint8_t SmbiosBcdRevision; } __attribute__((__packed__)) FFSmbios20EntryPoint; static_assert(offsetof(FFSmbios20EntryPoint, SmbiosBcdRevision) == 0x1E, - "FFSmbios30EntryPoint: Wrong struct alignment"); + "FFSmbios20EntryPoint: Wrong struct alignment"); typedef struct FFSmbios30EntryPoint { @@ -482,6 +482,8 @@ const FFSmbiosHeaderTable* ffGetSmbiosHeaderTable() if (!NT_SUCCESS(NtQuerySystemInformation(SystemFirmwareTableInformation, buffer, bufSize, &bufSize))) { FF_DEBUG("NtQuerySystemInformation(SystemFirmwareTableInformation) failed"); + free(buffer); + buffer = NULL; return NULL; } FFRawSmbiosData* rawData = (FFRawSmbiosData*) buffer->TableBuffer;