qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 14/29] hw/mips/mips_int.c: Fix memory leak spotted b


From: Shannon Zhao
Subject: [Qemu-devel] [PATCH 14/29] hw/mips/mips_int.c: Fix memory leak spotted by valgrind
Date: Thu, 28 May 2015 20:08:37 +0800

From: Shannon Zhao <address@hidden>

valgrind complains about:
==24666== 64 bytes in 1 blocks are definitely lost in loss record 1,564 of 2,346
==24666==    at 0x4C2845D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==24666==    by 0x2F5B8B: malloc_and_trace (vl.c:2556)
==24666==    by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==24666==    by 0x3842F7: qemu_extend_irqs (irq.c:55)
==24666==    by 0x384383: qemu_allocate_irqs (irq.c:64)
==24666==    by 0x244186: cpu_mips_irq_init_cpu (mips_int.c:65)
==24666==    by 0x244E88: mips_fulong2e_init (mips_fulong2e.c:345)
==24666==    by 0x2F9F56: main (vl.c:4249)

Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
---
 hw/mips/mips_int.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/mips/mips_int.c b/hw/mips/mips_int.c
index d740046..56b43da 100644
--- a/hw/mips/mips_int.c
+++ b/hw/mips/mips_int.c
@@ -66,6 +66,7 @@ void cpu_mips_irq_init_cpu(CPUMIPSState *env)
     for (i = 0; i < 8; i++) {
         env->irq[i] = qi[i];
     }
+    g_free(qi);
 }
 
 void cpu_mips_soft_irq(CPUMIPSState *env, int irq, int level)
-- 
2.0.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]