projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6aef0ff
)
xl: check json string is not null before printing in create_domain
author
Wei Liu
<wei.liu2@citrix.com>
Thu, 23 Jul 2015 07:59:06 +0000
(08:59 +0100)
committer
Ian Campbell
<ian.campbell@citrix.com>
Fri, 24 Jul 2015 10:27:52 +0000
(11:27 +0100)
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/xl_cmdimpl.c
patch
|
blob
|
history
diff --git
a/tools/libxl/xl_cmdimpl.c
b/tools/libxl/xl_cmdimpl.c
index 9027acba81e198a272397b3e431b391d1cfa9522..a38074fabdcd98edd5949654d3826fbc24d206a2 100644
(file)
--- a/
tools/libxl/xl_cmdimpl.c
+++ b/
tools/libxl/xl_cmdimpl.c
@@
-2781,6
+2781,11
@@
static uint32_t create_domain(struct domain_create *dom_info)
printf_info_sexp(-1, &d_config, cfg_print_fh);
} else {
char *json = libxl_domain_config_to_json(ctx, &d_config);
+ if (!json) {
+ fprintf(stderr,
+ "Failed to convert domain configuration to JSON\n");
+ exit(1);
+ }
fputs(json, cfg_print_fh);
free(json);
flush_stream(cfg_print_fh);