From 91ae19a7cc445030614bd0ae91548162cf0befbe Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 4 Dec 2009 16:15:10 +0000 Subject: [PATCH] xen_console: fix memory leak "type" Memory leak in con_init. Signed-off-by: Wei Kong --- hw/xen_console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/xen_console.c b/hw/xen_console.c index 2cdfb1f9..9110302e 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", -- 2.39.5