debuggers.hg

changeset 22058:82eeb70fb65c

libxl: ensure result of libxl_poolid_to_name is always dynamically allocated

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Ian Campbell <ian.campbell@citrix.com>
date Mon Aug 16 15:31:05 2010 +0100 (2010-08-16)
parents 0593371d0c5b
children 251dae6ee4a9
files tools/libxl/libxl_utils.c
line diff
     1.1 --- a/tools/libxl/libxl_utils.c	Mon Aug 16 15:31:05 2010 +0100
     1.2 +++ b/tools/libxl/libxl_utils.c	Mon Aug 16 15:31:05 2010 +0100
     1.3 @@ -97,7 +97,7 @@ char *libxl_poolid_to_name(libxl_ctx *ct
     1.4      char *s;
     1.5  
     1.6      if (poolid == 0)
     1.7 -        return "Pool-0";
     1.8 +        return strdup("Pool-0");
     1.9      snprintf(path, sizeof(path), "/local/pool/%d/name", poolid);
    1.10      s = xs_read(ctx->xsh, XBT_NULL, path, &len);
    1.11      return s;