WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] fix few small memory leaks in qemu

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] fix few small memory leaks in qemu
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 21 Oct 2009 17:31:18 +0100
Delivery-date: Wed, 21 Oct 2009 09:31:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
Hi all,
running qemu with valgrind I found few small memory leaks, this patch
fixes them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

---

diff --git a/hw/vga.c b/hw/vga.c
index 90bd544..ccbcda9 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 da278f4..2133cea 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);
 }
 
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>