]> xenbits.xensource.com Git - qemu-xen-unstable.git/commitdiff
fix few small memory leaks in qemu vga.c xenstore.c
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 22 Oct 2009 17:38:47 +0000 (18:38 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 22 Oct 2009 17:38:47 +0000 (18:38 +0100)
running qemu with valgrind I found few small memory leaks, this patch
fixes them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
hw/vga.c
xenstore.c

index 90bd544cf4cd9fdac2de7f3cc072014bf68914b7..ccbcda942614f6fac7508b51ad6599fef58ae1ef 100644 (file)
--- 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 */
index 694152a617b15b98ba28525385be24d7b8738ec4..b5a791e07982124470df892d40445e7bfb20c19e 100644 (file)
@@ -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);
 }