]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: log file name in failure in libxl__create_qemu_logfile
authorWei Liu <wei.liu2@citrix.com>
Mon, 6 Jun 2016 10:52:12 +0000 (11:52 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 14 Jun 2016 13:31:27 +0000 (14:31 +0100)
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_dm.c

index 6ff05c315fce371a42a5e5fd4e7abb6b78d94edf..de16a5912fabea29d9fddb3c567126e6c32674ed 100644 (file)
@@ -52,13 +52,15 @@ static int libxl__create_qemu_logfile(libxl__gc *gc, char *name)
     if (rc) return rc;
 
     logfile_w = open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0644);
-    free(logfile);
 
     if (logfile_w < 0) {
-        LOGE(ERROR, "unable to open Qemu logfile");
+        LOGE(ERROR, "unable to open Qemu logfile: %s", logfile);
+        free(logfile);
         return ERROR_FAIL;
     }
 
+    free(logfile);
+
     return logfile_w;
 }