diff mbox

[11/29] hw/ppc/mac_oldworld.c: Fix memory leak spotted by valgrind

Message ID 1432814932-12608-12-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:
==12412== 8 bytes in 1 blocks are definitely lost in loss record 448 of 3,760
==12412==    at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==12412==    by 0x336F37: malloc_and_trace (vl.c:2556)
==12412==    by 0x64C71F5: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
==12412==    by 0x64C7766: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.3600.3)
==12412==    by 0x26D448: ppc_heathrow_init (mac_oldworld.c:238)
==12412==    by 0x33B302: main (vl.c:4249)

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

Patch

diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index f26133d..f66b8aa 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -263,6 +263,7 @@  static void ppc_heathrow_init(MachineState *machine)
         hw_error("Only 6xx bus is supported on heathrow machine\n");
     }
     pic = heathrow_pic_init(&pic_mem, 1, heathrow_irqs);
+    g_free(heathrow_irqs);
     pci_bus = pci_grackle_init(0xfec00000, pic,
                                get_system_memory(),
                                get_system_io());