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-devel

[Xen-devel] [PATCH 08 of 26] libxl: ensure result of libxl_poolid_to_nam

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 08 of 26] libxl: ensure result of libxl_poolid_to_name is always dynamically allocated
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 16 Aug 2010 15:33:32 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Mon, 16 Aug 2010 07:37:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1281969204@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1281969065 -3600
# Node ID 9933762e16944f88d2e3a1637584d503d2b051ed
# Parent  3b7826a70148e2bf1e2bc9eecd7623a1f23a95fc
libxl: ensure result of libxl_poolid_to_name is always dynamically allocated

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 3b7826a70148 -r 9933762e1694 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Mon Aug 16 15:31:05 2010 +0100
+++ b/tools/libxl/libxl_utils.c Mon Aug 16 15:31:05 2010 +0100
@@ -97,7 +97,7 @@ char *libxl_poolid_to_name(libxl_ctx *ct
     char *s;
 
     if (poolid == 0)
-        return "Pool-0";
+        return strdup("Pool-0");
     snprintf(path, sizeof(path), "/local/pool/%d/name", poolid);
     s = xs_read(ctx->xsh, XBT_NULL, path, &len);
     return s;

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