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] xenstore: Fix memory leak in command '

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] xenstore: Fix memory leak in command 'xenstore rm'
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Dec 2009 03:05:36 -0800
Delivery-date: Mon, 21 Dec 2009 03:06:36 -0800
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 1261393103 0
# Node ID 95c6e90fcfefaa8d83f414a04086f4544b00f5ca
# Parent  561c444362d04f0eb156a895fbe8850210bea3fe
xenstore: Fix memory leak in command 'xenstore rm'

When option '-t' is used to do tidy remove, routine xs_directory()
will be called in order to check there are brother directories or not.
The returned pointer should be passed to free() after this check.

Signed-off-by: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>
xen-unstable changeset:   20703:1f315181731a
xen-unstable date:        Mon Dec 21 10:39:48 2009 +0000
---
 tools/xenstore/xenstore_client.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -r 561c444362d0 -r 95c6e90fcfef tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c  Mon Dec 21 10:58:00 2009 +0000
+++ b/tools/xenstore/xenstore_client.c  Mon Dec 21 10:58:23 2009 +0000
@@ -343,8 +343,10 @@ perform(enum mode mode, int optind, int 
                         unsigned int num;
                         char ** list = xs_directory(xsh, xth, p, &num);
 
-                        if (list && num == 0) {
-                            goto again;
+                        if (list) {
+                            free(list);
+                            if (num == 0)
+                                goto again;
                         }
                     }
                 }

_______________________________________________
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] xenstore: Fix memory leak in command 'xenstore rm', Xen patchbot-3.4-testing <=