From 15cea92d9e8afd4472147e54efe2eef0b7754dcd Mon Sep 17 00:00:00 2001 From: PanNengyuan Date: Tue, 19 Nov 2019 15:12:09 +0100 Subject: [PATCH] gpio: fix memory leak in aspeed_gpio_init() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Address Sanitizer shows memory leak in hw/gpio/aspeed_gpio.c:875 Reported-by: Euler Robot Signed-off-by: PanNengyuan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater Message-id: 20191119141211.25716-16-clg@kaod.org Signed-off-by: Peter Maydell --- hw/gpio/aspeed_gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 7acc5fa8e2..41e11ea9b0 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -876,6 +876,7 @@ static void aspeed_gpio_init(Object *obj) pin_idx % GPIOS_PER_GROUP); object_property_add(obj, name, "bool", aspeed_gpio_get_pin, aspeed_gpio_set_pin, NULL, NULL, NULL); + g_free(name); } } -- 2.11.0