aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorPan Nengyuan <pannengyuan@huawei.com>2020-03-07 11:07:56 +0800
committerLaurent Vivier <laurent@vivier.eu>2020-03-09 15:59:31 +0100
commit2244f2335ea8f3b92cbecbb123dc392570b06e6c (patch)
tree9e2324a5487c849df87ed2ba61d373ea05e14118 /hw/core
parentfe8ce968c13ab58f42068eb0a7d557b1d209cd8d (diff)
downloadqemu-2244f2335ea8f3b92cbecbb123dc392570b06e6c.zip
qemu-2244f2335ea8f3b92cbecbb123dc392570b06e6c.tar.gz
qemu-2244f2335ea8f3b92cbecbb123dc392570b06e6c.tar.bz2
core/qdev: fix memleak in qdev_get_gpio_out_connector()
Fix a memory leak in qdev_get_gpio_out_connector(). Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200307030756.5913-1-pannengyuan@huawei.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 3937d1e..85f062d 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,