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

[Xen-changelog] [qemu-xen-unstable] xen_console: fix memory leak "type"



commit 91ae19a7cc445030614bd0ae91548162cf0befbe
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Fri Dec 4 16:15:10 2009 +0000

    xen_console: fix memory leak "type"
    
    Memory leak in con_init.
    
    Signed-off-by: Wei Kong <weikong.cn@xxxxxxxxx>
---
 hw/xen_console.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/xen_console.c b/hw/xen_console.c
index 2cdfb1f..9110302 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -194,8 +194,11 @@ static int con_init(struct XenDevice *xendev)
     type = xenstore_read_str(con->console, "type");
     if (!type || 0 != strcmp(type, "ioemu")) {
        xen_be_printf(xendev, 1, "not for me (type=%s)\n", type);
+       if (type)
+           qemu_free(type);
        return -1;
     }
+    qemu_free(type);
 
     if (!serial_hds[con->xendev.dev])
        xen_be_printf(xendev, 1, "WARNING: serial line %d not configured\n",
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.