[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/30] vl: fix memory leak spotted by valgrind
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 09/30] vl: fix memory leak spotted by valgrind |
Date: |
Wed, 3 Jun 2015 16:08:29 +0300 |
From: Shannon Zhao <address@hidden>
valgrind complains about:
==9276== 13 bytes in 1 blocks are definitely lost in loss record 1,046 of 3,673
==9276== at 0x4C2845D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==9276== by 0x2EAFBB: malloc_and_trace (vl.c:2556)
==9276== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==9276== by 0x4A28BD: addr_to_string (vnc.c:123)
==9276== by 0x4A29AD: vnc_socket_local_addr (vnc.c:139)
==9276== by 0x4A9AFE: vnc_display_local_addr (vnc.c:3240)
==9276== by 0x2EF4FE: main (vl.c:4321)
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
vl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/vl.c b/vl.c
index 1d4c089..3893c84 100644
--- a/vl.c
+++ b/vl.c
@@ -4312,8 +4312,9 @@ int main(int argc, char **argv, char **envp)
/* init remote displays */
qemu_opts_foreach(qemu_find_opts("vnc"), vnc_init_func, NULL, 0);
if (show_vnc_port) {
- printf("VNC server running on `%s'\n",
- vnc_display_local_addr("default"));
+ char *ret = vnc_display_local_addr("default");
+ printf("VNC server running on `%s'\n", ret);
+ g_free(ret);
}
#endif
#ifdef CONFIG_SPICE
--
2.1.4
- [Qemu-devel] [PULL 13/30] hw/intc/exynos4210_gic.c: Fix memory leak by adjusting order, (continued)
- [Qemu-devel] [PULL 13/30] hw/intc/exynos4210_gic.c: Fix memory leak by adjusting order, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 16/30] hw/isa/i82378.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 19/30] hw/ppc/prep.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 14/30] hw/i386/pc: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 01/30] iscsi: Remove pointless runtime check of macro value, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 27/30] translate-all: delete prototype for non-existent function, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 12/30] hw/arm/omap_sx1.c: Fix memory leak spotted by valgrind, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 02/30] microblaze: cpu: Delete MMAP_SHIFT definition, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 21/30] hw/lm32/milkymist.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 11/30] hw/ppc/e500.c: Fix memory leak, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 09/30] vl: fix memory leak spotted by valgrind,
Michael Tokarev <=
- [Qemu-devel] [PULL 26/30] Add -incoming help text, Michael Tokarev, 2015/06/03
- Re: [Qemu-devel] [PULL 00/30] Trivial patches for 2015-06-03, Peter Maydell, 2015/06/04