diff mbox

[25/29] hw/arm/palm.c: Fix memory leak spotted by valgrind

Message ID 1432814932-12608-26-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

Shannon Zhao May 28, 2015, 12:08 p.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

valgrind complains about:
==27206== 56 bytes in 1 blocks are definitely lost in loss record 2,000 of 3,127
==27206==    at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==27206==    by 0x35479F: malloc_and_trace (vl.c:2556)
==27206==    by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==27206==    by 0x3ED99B: qemu_extend_irqs (irq.c:55)
==27206==    by 0x3EDA27: qemu_allocate_irqs (irq.c:64)
==27206==    by 0x283C8B: palmte_gpio_setup (palm.c:168)
==27206==    by 0x2840FA: palmte_init (palm.c:239)
==27206==    by 0x358B6A: main (vl.c:4249)

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 hw/arm/palm.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/hw/arm/palm.c b/hw/arm/palm.c
index 7f1cfb8..4e00695 100644
--- a/hw/arm/palm.c
+++ b/hw/arm/palm.c
@@ -173,6 +173,7 @@  static void palmte_gpio_setup(struct omap_mpu_state_s *cpu)
     qdev_connect_gpio_out(cpu->gpio, 13,			misc_gpio[4]);
     omap_mpuio_out_set(cpu->mpuio, 1,				misc_gpio[5]);
     omap_mpuio_out_set(cpu->mpuio, 3,				misc_gpio[6]);
+    g_free(misc_gpio);
 
     /* Reset some inputs to initial state.  */
     qemu_irq_lower(qdev_get_gpio_in(cpu->gpio, PALMTE_USBDETECT_GPIO));