Commit 8f627bf1be for qemu.org
commit 8f627bf1be077382f8ebf2cbda5cfb7e94006c54
Author: Fabiano Rosas <farosas@suse.de>
Date: Fri Mar 13 15:29:54 2026 -0300
tests/qtest/test-hmp: Free machine options
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>
diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c
index 60f742e83f..a523dbb446 100644
--- a/tests/qtest/test-hmp.c
+++ b/tests/qtest/test-hmp.c
@@ -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();
}