]> xenbits.xensource.com Git - qemu-xen-4.0-testing.git/commitdiff
xen_console: fix memory leak "type"
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 4 Dec 2009 16:15:10 +0000 (16:15 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 12 Jan 2010 17:53:13 +0000 (17:53 +0000)
Memory leak in con_init.

Signed-off-by: Wei Kong <weikong.cn@gmail.com>
(cherry picked from commit 91ae19a7cc445030614bd0ae91548162cf0befbe)

hw/xen_console.c

index c172cf2bc9df36ce6c31368a4be0c913eda5f589..6b0811eb427fa322e8e6ba349aa4330a45047b06 100644 (file)
@@ -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",