diff mbox series

vl: Free machine list

Message ID 20230722062641.18505-1-akihiko.odaki@daynix.com
State New
Headers show
Series vl: Free machine list | expand

Commit Message

Akihiko Odaki July 22, 2023, 6:26 a.m. UTC
Free machine list and make LeakSanitizer happy.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 softmmu/vl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Akihiko Odaki Sept. 21, 2023, 7:11 a.m. UTC | #1
On 2023/07/22 15:26, Akihiko Odaki wrote:
> Free machine list and make LeakSanitizer happy.
> 
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>   softmmu/vl.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index b0b96f67fa..802f728298 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -1484,7 +1484,8 @@ static gint machine_class_cmp(gconstpointer a, gconstpointer b)
>   
>   static void machine_help_func(const QDict *qdict)
>   {
> -    GSList *machines, *el;
> +    g_autoptr(GSList) machines = NULL;
> +    GSList *el;
>       const char *type = qdict_get_try_str(qdict, "type");
>   
>       machines = object_class_get_list(TYPE_MACHINE, false);

Hi Paolo,

Can you have a look at this patch?

Regards,
Akihiko Odaki
Philippe Mathieu-Daudé Sept. 21, 2023, 10:13 a.m. UTC | #2
On 22/7/23 08:26, Akihiko Odaki wrote:
> Free machine list and make LeakSanitizer happy.
> 
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>   softmmu/vl.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index b0b96f67fa..802f728298 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -1484,7 +1484,8 @@ static gint machine_class_cmp(gconstpointer a, gconstpointer b)
>   
>   static void machine_help_func(const QDict *qdict)
>   {
> -    GSList *machines, *el;
> +    g_autoptr(GSList) machines = NULL;
> +    GSList *el;
>       const char *type = qdict_get_try_str(qdict, "type");
>   
>       machines = object_class_get_list(TYPE_MACHINE, false);

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/softmmu/vl.c b/softmmu/vl.c
index b0b96f67fa..802f728298 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -1484,7 +1484,8 @@  static gint machine_class_cmp(gconstpointer a, gconstpointer b)
 
 static void machine_help_func(const QDict *qdict)
 {
-    GSList *machines, *el;
+    g_autoptr(GSList) machines = NULL;
+    GSList *el;
     const char *type = qdict_get_try_str(qdict, "type");
 
     machines = object_class_get_list(TYPE_MACHINE, false);