From af5102b81fd036976e785aa29dece8c3d2dd6577 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Wed, 8 May 2013 05:47:53 +0200 Subject: libxl: do not call exit() in libxl_device_vtpm_list Signal error with NULL return value, do not terminate the whole process. Signed-off-by: Marek Marczykowski Reviewed-by: Jim Fehlig Acked-by: Ian Campbell --- tools/libxl/libxl.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tools/libxl') diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 3236aa96a0..bd63a305d7 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -1861,11 +1861,12 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *n vtpm->backend_domid = atoi(tmp); tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/uuid", be_path)); - if(tmp) { - if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) { - LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a bug!!\n", be_path, tmp); - exit(1); - } + if (tmp) { + if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) { + LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a bug!!\n", be_path, tmp); + free(vtpms); + return NULL; + } } } } -- cgit v1.2.3