tests/qtest: Free old machine variable name

This fixes LeakSanitizer warnings.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20240627-san-v2-12-750bb0946dbd@daynix.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Akihiko Odaki 2024-06-27 22:37:55 +09:00 committed by Thomas Huth
parent f48b7a4b69
commit 0d626d12eb
1 changed files with 1 additions and 0 deletions

View File

@ -1514,6 +1514,7 @@ static struct MachInfo *qtest_get_machines(const char *var)
int idx;
if (g_strcmp0(qemu_var, var)) {
g_free(qemu_var);
qemu_var = g_strdup(var);
/* new qemu, clear the cache */