[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] core/qdev: fix memleak in qdev_get_gpio_out_connector()
From: |
Laurent Vivier |
Subject: |
Re: [PATCH] core/qdev: fix memleak in qdev_get_gpio_out_connector() |
Date: |
Mon, 9 Mar 2020 13:05:51 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
Le 07/03/2020 à 04:07, Pan Nengyuan a écrit :
> Fix a memory leak in qdev_get_gpio_out_connector().
>
> Reported-by: Euler Robot <address@hidden>
> Signed-off-by: Pan Nengyuan <address@hidden>
> ---
> hw/core/qdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index 3937d1eb1a..85f062def7 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -557,7 +557,7 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const
> char *name, int n,
>
> qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int
> n)
> {
> - char *propname = g_strdup_printf("%s[%d]",
> + g_autofree char *propname = g_strdup_printf("%s[%d]",
> name ? name : "unnamed-gpio-out", n);
>
> qemu_irq ret = (qemu_irq)object_property_get_link(OBJECT(dev), propname,
>
Applied to my trivial-patches branch.
Thanks,
Laurent