]> xenbits.xensource.com Git - libvirt.git/commitdiff
testutilsxen: error out on initialization failure
authorJán Tomko <jtomko@redhat.com>
Sat, 22 Feb 2020 11:44:45 +0000 (12:44 +0100)
committerJán Tomko <jtomko@redhat.com>
Tue, 25 Feb 2020 11:05:00 +0000 (12:05 +0100)
libxlDriverConfigNew can possibly fail on wrong
firmware values (unlikely) or on failure to create
the log directory (possible if you're debugging
tests with VIR_FILE_ACCESS)

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 4a4132b4625778cf80acb9c92d06351b44468ac3
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
tests/testutilsxen.c

index b73c79581d7212ec4487d1f1c79b0fccc24eeab8..76da33826c6cbc2dd5dbaa3f8ee25e4dcd1c09d5 100644 (file)
@@ -94,7 +94,8 @@ libxlDriverPrivatePtr testXLInitDriver(void)
         return NULL;
     }
 
-    driver->config = libxlDriverConfigNew();
+    if (!(driver->config = libxlDriverConfigNew()))
+        return NULL;
 
     driver->config->caps = testXLInitCaps();