gpio: fix memory leak in aspeed_gpio_init()
PATCH 1/1 gpio: fix memory leak in aspeed_gpio_init()
From: PanNengyuan <[email protected]>
Address Sanitizer shows memory leak in hw/gpio/aspeed_gpio.c:875
Reported-by Euler Robot <[email protected]>
Signed-off-by PanNengyuan <[email protected]>
--- hw/gpio/aspeed_gpio.c | 1 + 1 file changed, 1 insertion(+)
hw/gpio/aspeed_gpio.c +1 -0
@@ -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); } }
Signature · 1 line
2.7.2.windows.1
Quoted 6 lines · On 18/11/2019 02:37, [email protected] wrote:
From: PanNengyuan <[email protected]>
Address Sanitizer shows memory leak in
hw/gpio/aspeed_gpio.c:875Reported-by Euler Robot <[email protected]>Signed-off-by PanNengyuan <[email protected]>
Reviewed-by Cédric Le Goater <[email protected]>
I will add this patch the series I am building for 5.0.
Thanks,
C.
Quoted 17 lines
--- hw/gpio/aspeed_gpio.c | 1 + 1 file changed, 1 insertion(+)hw/gpio/aspeed_gpio.c +1
-0@@ -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); } }