[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/19] smbios: clear smbios_tables pointer after freeing
From: |
Igor Mammedov |
Subject: |
[PATCH 11/19] smbios: clear smbios_tables pointer after freeing |
Date: |
Tue, 27 Feb 2024 16:47:41 +0100 |
that will avoid double free if smbios_get_tables() is called
multiple times.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
hw/smbios/smbios.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 7c28b5f748..d9ba2072b1 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -1052,6 +1052,8 @@ void smbios_get_tables(MachineState *ms,
return;
err_exit:
g_free(smbios_tables);
+ smbios_tables = NULL;
+ return;
}
static void save_opt(const char **dest, QemuOpts *opts, const char *name)
--
2.39.3
- [PATCH 00/19] Workaround Windows failing to find 64bit SMBIOS entry point with SeaBIOS, Igor Mammedov, 2024/02/27
- [PATCH 01/19] tests: smbios: make it possible to write SMBIOS only test, Igor Mammedov, 2024/02/27
- [PATCH 02/19] tests: smbios: add test for -smbios type=11 option, Igor Mammedov, 2024/02/27
- [PATCH 04/19] smbios: cleanup smbios_get_tables() from legacy handling, Igor Mammedov, 2024/02/27
- [PATCH 05/19] smbios: get rid of smbios_smp_sockets global, Igor Mammedov, 2024/02/27
- [PATCH 06/19] smbios: get rid of smbios_legacy global, Igor Mammedov, 2024/02/27
- [PATCH 03/19] tests: smbios: add test for legacy mode CLI options, Igor Mammedov, 2024/02/27
- [PATCH 10/19] smbios: handle errors consistently, Igor Mammedov, 2024/02/27
- [PATCH 08/19] smbios: don't check type4 structures in legacy mode, Igor Mammedov, 2024/02/27
- [PATCH 11/19] smbios: clear smbios_tables pointer after freeing,
Igor Mammedov <=
- [PATCH 12/19] get rid of global smbios_ep_type, Igor Mammedov, 2024/02/27
- [PATCH 07/19] smbios: avoid mangling user provided tables, Igor Mammedov, 2024/02/27
- [PATCH 13/19] smbios: extend smbios-entry-point-type with 'auto' value, Igor Mammedov, 2024/02/27
- [PATCH 09/19] smbios: build legacy mode code only for 'pc' machine, Igor Mammedov, 2024/02/27
- [PATCH 17/19] tests: acpi/smbios: whitelist expected blobs, Igor Mammedov, 2024/02/27
- [PATCH 14/19] smbios: in case of entry point is 'auto' try to build v2 tables 1st, Igor Mammedov, 2024/02/27
- [PATCH 18/19] pc/q35: set SMBIOS entry point type to 'auto' by default, Igor Mammedov, 2024/02/27
- [PATCH 16/19] smbios: clear smbios_type4_count before building tables, Igor Mammedov, 2024/02/27
- [PATCH 19/19] tests: acpi: update expected SSDT.dimmpxm blob, Igor Mammedov, 2024/02/27