WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [qemu-xen-unstable] xen_console: fix memory leak "type"
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Fri, 4 Dec 2009 08:20:31 -0800
Delivery-date: Fri, 04 Dec 2009 08:20:29 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [qemu-xen-unstable] xen_console: fix memory leak "type", Ian Jackson <=