aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2024-06-27 22:37:55 +0900
committerThomas Huth <thuth@redhat.com>2024-07-02 09:34:55 +0200
commit0d626d12eb3e550a1ac0dd2e505042ed1fb4d50b (patch)
tree05333bfc5b0b5df78e57554bb739e25900777d71
parentf48b7a4b69b55ed0c9e74013822ee3b16d8d7055 (diff)
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>
-rw-r--r--tests/qtest/libqtest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index ca46b1f8d0..1326e34291 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -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 */