From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 4 of 9] libxl: ensure result of libxl_poolid_to_name is always dynamically allocated Date: Fri, 13 Aug 2010 14:50:07 +0100 Message-ID: <4fa4efb9c63e1ef60daa.1281707407@localhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Ian Campbell # Date 1281706573 -3600 # Node ID 4fa4efb9c63e1ef60daae928b0d7c5ca992681dd # Parent 06e63fc8240a8d5902087947e016b7f69ab53071 libxl: ensure result of libxl_poolid_to_name is always dynamically allocated Signed-off-by: Ian Campbell diff -r 06e63fc8240a -r 4fa4efb9c63e tools/libxl/libxl_utils.c --- a/tools/libxl/libxl_utils.c Fri Aug 13 14:36:13 2010 +0100 +++ b/tools/libxl/libxl_utils.c Fri Aug 13 14:36:13 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;