From 8c85d519266c99b729a8c14fa213e825a63d1c1e Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 16 Jun 2021 09:29:01 +0200 Subject: [PATCH] qemu: firmware: Store machine types as a NULL-terminated string list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_firmware.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 17380b7573..529ab8d68e 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -239,7 +239,7 @@ qemuFirmwareTargetFree(qemuFirmwareTarget *target) if (!target) return; - virStringListFreeCount(target->machines, target->nmachines); + g_strfreev(target->machines); g_free(target); } @@ -534,7 +534,7 @@ qemuFirmwareTargetParse(const char *path, nmachines = virJSONValueArraySize(machines); - t->machines = g_new0(char *, nmachines); + t->machines = g_new0(char *, nmachines + 1); for (j = 0; j < nmachines; j++) { virJSONValue *machine = virJSONValueArrayGet(machines, j);