From: Vladimir Sementsov-Ogievskiy Date: Wed, 26 Jun 2024 13:43:04 +0000 (+0300) Subject: vl.c: select_machine(): use g_autoptr X-Git-Tag: qemu-xen-4.20.0~96^2~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0e460ac329980d90bafd400cc1756df8fb72e41a;p=qemu-xen.git vl.c: select_machine(): use g_autoptr Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- diff --git a/system/vl.c b/system/vl.c index fda93d150c..92fc29c193 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1667,7 +1667,7 @@ static MachineClass *select_machine(QDict *qdict, Error **errp) { ERRP_GUARD(); const char *machine_type = qdict_get_try_str(qdict, "type"); - GSList *machines = object_class_get_list(TYPE_MACHINE, false); + g_autoptr(GSList) machines = object_class_get_list(TYPE_MACHINE, false); MachineClass *machine_class = NULL; if (machine_type) { @@ -1683,7 +1683,6 @@ static MachineClass *select_machine(QDict *qdict, Error **errp) } } - g_slist_free(machines); if (!machine_class) { error_append_hint(errp, "Use -machine help to list supported machines\n");