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

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



commit 07fd010f8c4d5ae19ecdb202819a03579009da43
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>
    (cherry picked from commit 91ae19a7cc445030614bd0ae91548162cf0befbe)
---
 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 c172cf2..6b0811e 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -197,8 +197,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-3.4-testing.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®.