]> xenbits.xensource.com Git - xen.git/commitdiff
xl: 'replace_string' now uses xstrdup
authorDavid Scott <dave.scott@citrix.com>
Thu, 9 Oct 2014 09:17:30 +0000 (10:17 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 20 Oct 2014 12:51:29 +0000 (13:51 +0100)
This catches the out-of-memory exception and exits the program.

Signed-off-by: David Scott <dave.scott@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/xl_cmdimpl.c

index be809c8fb471aaa12c3c27334a1dce9a82f91cb2..70d70bdfb0730e915c79c650fdf00493220a2edd 100644 (file)
@@ -839,7 +839,7 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,
 static void replace_string(char **str, const char *val)
 {
     free(*str);
-    *str = strdup(val);
+    *str = xstrdup(val);
 }
 
 static void parse_config_data(const char *config_source,