From: "James Song" Subject: fix some memory leaks in tools Date: Tue, 09 Dec 2008 20:08:10 -0700 Message-ID: <493FCD4B0200002000008BD5@lucius.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1965528862==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --===============1965528862== Content-Type: multipart/alternative; boundary="=__PartA68EDD8A.0__=" This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartA68EDD8A.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Signed-off-by: James Song Name: tools-memleak.patch Type: text/x-patch diff -r 128086d44a42 tools/python/xen/lowlevel/flask/flask.c --- a/tools/python/xen/lowlevel/flask/flask.c Fri Dec 05 17:39:58 2008 = +0800 +++ b/tools/python/xen/lowlevel/flask/flask.c Tue Dec 09 13:14:44 2008 = +0800 @@ -55,6 +55,7 @@ xc_handle =3D xc_interface_open(); if (xc_handle < 0) { errno =3D xc_handle; + free(buf); return PyErr_SetFromErrno(xc_error_obj); } diff -r 128086d44a42 tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Fri Dec 05 17:39:58 2008 +0800 +++ b/tools/python/xen/lowlevel/xc/xc.c Tue Dec 09 13:14:44 2008 +0800 @@ -690,7 +690,10 @@ group_str =3D calloc(num_sdevs, sizeof(dev_str)); if (group_str =3D=3D NULL) + { + free(sdev_array); return PyErr_NoMemory(); + } for ( i =3D 0; i < num_sdevs; i++ ) { --thanks James. --=__PartA68EDD8A.0__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Signed-off-by: James Song <jsong@novell.com>
Na= me: tools-memleak.patch
Type: text/x-patch

diff -r 128086d44a42 = tools/python/xen/lowlevel/flask/flask.c
--- a/tools/python/xen/lowlevel/= flask/flask.c   Fri Dec 05 17:39:58 2008 +0800
+++ b/tools/pyt= hon/xen/lowlevel/flask/flask.c   Tue Dec 09 13:14:44 2008 = +0800
@@ -55,6 +55,7 @@
     xc_handle =3D = xc_interface_open();
     if (xc_handle < 0) = {
         errno =3D xc_handle;<= br>+        free(buf);
  &n= bsp;      return PyErr_SetFromErrno(xc_error_obj);=
     }

diff -r 128086d44a42 tools/python/xen= /lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Fri Dec 05 = 17:39:58 2008 +0800
+++ b/tools/python/xen/lowlevel/xc/xc.c Tue Dec 09 = 13:14:44 2008 +0800
@@ -690,7 +690,10 @@

    = group_str =3D calloc(num_sdevs, sizeof(dev_str));
   &nb= sp; if (group_str =3D=3D NULL)
+    {
+  &nb= sp;     free(sdev_array);
    &n= bsp;    return PyErr_NoMemory();
+    = ; }

     for ( i =3D 0; i < num_sdevs; i++ = )
     {

--thanks
 James.
<= /html> --=__PartA68EDD8A.0__=-- --===============1965528862== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1965528862==--