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

[Xen-changelog] On one of pyxc_domain_getinfo's error paths, free the block allocated



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.