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] libxl: fix memory leak in libxl_name_to_p

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: fix memory leak in libxl_name_to_poolid
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 11 Aug 2010 13:55:29 -0700
Delivery-date: Wed, 11 Aug 2010 13:56:15 -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 Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
# Date 1281004393 -3600
# Node ID baaa4b9d385f5d00083413dad1d65570c2f5fae7
# Parent  d627f6b581b4346b5edb13d341e027b22c15f1a1
libxl: fix memory leak in libxl_name_to_poolid

Signed-off-by: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_utils.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff -r d627f6b581b4 -r baaa4b9d385f tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Wed Aug 04 18:08:39 2010 +0100
+++ b/tools/libxl/libxl_utils.c Thu Aug 05 11:33:13 2010 +0100
@@ -101,6 +101,7 @@ int libxl_name_to_poolid(libxl_ctx *ctx,
     int i, nb_pools;
     char *poolname;
     libxl_poolinfo *poolinfo;
+    int ret = -1;
 
     poolinfo = libxl_list_pool(ctx, &nb_pools);
     if (!poolinfo)
@@ -112,10 +113,12 @@ int libxl_name_to_poolid(libxl_ctx *ctx,
             continue;
         if (strcmp(poolname, name) == 0) {
             *poolid = poolinfo[i].poolid;
-            return 0;
-        }
-    }
-    return -1;
+            ret = 0;
+            break;
+        }
+    }
+    free(poolinfo);
+    return ret;
 }
 
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid)

_______________________________________________
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] libxl: fix memory leak in libxl_name_to_poolid, Xen patchbot-unstable <=