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-3.4-testing] Fix memory leak in libxenstore python

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] Fix memory leak in libxenstore python bindings
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 01 Oct 2009 08:25:34 -0700
Delivery-date: Thu, 01 Oct 2009 08:27:26 -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 1254410220 -3600
# Node ID 123e6ca38b5c4ca7e7baf5b4d005df1adb9d84e3
# Parent  9ea1640248e78065851e4098f94a4a139fb5524e
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>
xen-unstable changeset:   20266:9489dc216321
xen-unstable date:        Thu Oct 01 12:26:15 2009 +0100
---
 tools/python/xen/lowlevel/xs/xs.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -r 9ea1640248e7 -r 123e6ca38b5c tools/python/xen/lowlevel/xs/xs.c
--- a/tools/python/xen/lowlevel/xs/xs.c Thu Oct 01 16:16:39 2009 +0100
+++ b/tools/python/xen/lowlevel/xs/xs.c Thu Oct 01 16:17:00 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-3.4-testing] Fix memory leak in libxenstore python bindings, Xen patchbot-3.4-testing <=