From: Ian Jackson Date: Thu, 22 Oct 2009 17:38:47 +0000 (+0100) Subject: fix few small memory leaks in qemu vga.c xenstore.c X-Git-Tag: xen-4.0.0-rc1~14 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7990ddfd1119657fef7c661156a25d00e184766d;p=qemu-xen-4.3-testing.git fix few small memory leaks in qemu vga.c xenstore.c running qemu with valgrind I found few small memory leaks, this patch fixes them. Signed-off-by: Stefano Stabellini --- diff --git a/hw/vga.c b/hw/vga.c index 90bd544cf..ccbcda942 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -2538,6 +2538,7 @@ void xen_vga_vram_map(uint64_t vram_addr, uint32_t vga_ram_size) #ifdef CONFIG_STUBDOM xenfb_pv_display_vram(vram); #endif + free(pfn_list); } /* when used on xen environment, the vga_ram_base is not used */ diff --git a/xenstore.c b/xenstore.c index 694152a61..b5a791e07 100644 --- a/xenstore.c +++ b/xenstore.c @@ -709,7 +709,7 @@ static void xenstore_process_logdirty_event(void) act = xs_read(xsh, XBT_NULL, cmd_path, &len); if (!act) { fprintf(logfile, "Log-dirty: no command yet.\n"); - return; + goto out; } fprintf(logfile, "Log-dirty command %s\n", act); @@ -724,7 +724,11 @@ static void xenstore_process_logdirty_event(void) /* Ack that we've service the command */ xs_write(xsh, XBT_NULL, ret_path, act, len); + free(act); +out: + free(ret_path); + free(cmd_path); }