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] On one of pyxc_domain_getinfo's error paths, free the bl

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] On one of pyxc_domain_getinfo's error paths, free the block allocated
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 21 Sep 2005 14:58:14 +0000
Delivery-date: Wed, 21 Sep 2005 14:57:17 +0000
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@ewan
# Node ID 1196da5782bf4d529042ddc0b0c3ae6dfd1a6578
# Parent  a35c20d53947d5cdfb64b0d09fcbb85cd63acbc1
On one of pyxc_domain_getinfo's error paths, free the block allocated
previously.  This would have caused a memory leak when attempting to get info
on a domain that does not exist.
 
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r a35c20d53947 -r 1196da5782bf tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Tue Sep 20 16:31:22 2005
+++ b/tools/python/xen/lowlevel/xc/xc.c Wed Sep 21 10:24:26 2005
@@ -222,8 +222,11 @@
     nr_doms = xc_domain_getinfo(xc->xc_handle, first_dom, max_doms, info);
 
     if (nr_doms < 0)
-        return PyErr_SetFromErrno(xc_error);
-    
+    {
+        free(info);
+        return PyErr_SetFromErrno(xc_error);
+    }
+
     list = PyList_New(nr_doms);
     for ( i = 0 ; i < nr_doms; i++ )
     {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] On one of pyxc_domain_getinfo's error paths, free the block allocated, Xen patchbot -unstable <=