]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
hw/arm/iotkit.c: fix minor memory leak
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 10 May 2018 17:10:56 +0000 (18:10 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 10 May 2018 17:10:56 +0000 (18:10 +0100)
Coverity (CID1390573) spots that we forgot to free the
gpioname strings in a loop in the iotkit realize function.
Correct the error.

This isn't a significant leak, because this function
only ever runs once.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-id: 20180427110137.19304-1-peter.maydell@linaro.org

hw/arm/iotkit.c

index c5f0a5b98abc8d4583bdba2f7c9293cf76475570..234185e8f78e32d69ed10e54810847c93d3054c5 100644 (file)
@@ -517,6 +517,7 @@ static void iotkit_realize(DeviceState *dev, Error **errp)
                               qdev_get_gpio_in(DEVICE(&s->ppc_irq_orgate), i));
         qdev_connect_gpio_out_named(DEVICE(ppc), "irq", 0,
                                     qdev_get_gpio_in(devs, 0));
+        g_free(gpioname);
     }
 
     iotkit_forward_sec_resp_cfg(s);