]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/qtest/test-hmp: Free machine options
authorFabiano Rosas <farosas@suse.de>
Fri, 13 Mar 2026 18:29:54 +0000 (15:29 -0300)
committerFabiano Rosas <farosas@suse.de>
Tue, 17 Mar 2026 17:58:09 +0000 (14:58 -0300)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260313182957.28432-3-farosas@suse.de
Signed-off-by: Fabiano Rosas <farosas@suse.de>
tests/qtest/test-hmp.c

index 60f742e83fa1f9bf0bc6128ee58a2f9ced7f8f32..a523dbb446cea5737028fa7baf8c7bf8ba3043fe 100644 (file)
@@ -149,6 +149,7 @@ static void add_machine_test_case(const char *mname)
 int main(int argc, char **argv)
 {
     char *v_env = getenv("V");
+    g_autofree char *machine_opts = g_strdup("none -m 2");
 
     if (v_env && atoi(v_env) >= 2) {
         verbose = true;
@@ -159,7 +160,7 @@ int main(int argc, char **argv)
     qtest_cb_for_every_machine(add_machine_test_case, g_test_quick());
 
     /* as none machine has no memory by default, add a test case with memory */
-    qtest_add_data_func("hmp/none+2MB", g_strdup("none -m 2"), test_machine);
+    qtest_add_data_func("hmp/none+2MB", machine_opts, test_machine);
 
     return g_test_run();
 }