From: Guido Günther Date: Mon, 7 Apr 2014 06:53:26 +0000 (+0200) Subject: tests: Don't crash when creating the config object fails X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ff32ac06f5378330e50bb79faa087485321ac1bb;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git tests: Don't crash when creating the config object fails As observed when building in a chroot and QEMU_USER doesn't exist --- diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index 6d7e23e94..4cc3749da 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -128,6 +128,9 @@ mymain(void) int ret = 0; driver.config = virQEMUDriverConfigNew(false); + if (driver.config == NULL) + return EXIT_FAILURE; + if ((driver.caps = testQemuCapsInit()) == NULL) return EXIT_FAILURE; diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 56854dcda..13ed4f6f4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -501,6 +501,9 @@ mymain(void) } driver.config = virQEMUDriverConfigNew(true); + if (driver.config == NULL) + return EXIT_FAILURE; + VIR_FREE(driver.config->spiceListen); VIR_FREE(driver.config->vncListen);