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] [xen-unstable] Fix memory leak in libxenstore python bin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix memory leak in libxenstore python bindings
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 01 Oct 2009 04:35:12 -0700
Delivery-date: Thu, 01 Oct 2009 04:36:34 -0700
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
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1254396375 -3600
# Node ID 9489dc2163213c5b630504f00808e34b8d63ef63
# Parent  26708cdf86be4a796a51c7770bab2c18c525671d
Fix memory leak in libxenstore python bindings

Temporary tuple0 python object was not freed at the end of
xspy_set_permissions() in case no error occurred. To reduce code
duplication, this path reuses the cleanup code.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 tools/python/xen/lowlevel/xs/xs.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -r 26708cdf86be -r 9489dc216321 tools/python/xen/lowlevel/xs/xs.c
--- a/tools/python/xen/lowlevel/xs/xs.c Thu Oct 01 12:25:36 2009 +0100
+++ b/tools/python/xen/lowlevel/xs/xs.c Thu Oct 01 12:26:15 2009 +0100
@@ -324,6 +324,7 @@ static PyObject *xspy_set_permissions(Xs
 
     xs_transaction_t th;
     char *thstr;
+    PyObject *ret = NULL;
 
     if (!xh)
         goto exit;
@@ -380,14 +381,13 @@ static PyObject *xspy_set_permissions(Xs
         goto exit;
     }
 
-    free(xsperms);
     Py_INCREF(Py_None);
-    return Py_None;
+    ret = Py_None;
 
  exit:
     Py_XDECREF(tuple0);
     free(xsperms);
-    return NULL;
+    return ret;
 }
 
 #define xspy_watch_doc "\n"                                            \

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix memory leak in libxenstore python bindings, Xen patchbot-unstable <=