[PATCH] vl: Free machine list

Akihiko Odaki posted 1 patch 9 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230722062641.18505-1-akihiko.odaki@daynix.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>
softmmu/vl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] vl: Free machine list
Posted by Akihiko Odaki 9 months, 1 week ago
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);
-- 
2.41.0
Re: [PATCH] vl: Free machine list
Posted by Philippe Mathieu-Daudé 7 months, 1 week ago
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>


Re: [PATCH] vl: Free machine list
Posted by Akihiko Odaki 7 months, 1 week ago
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