mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
tests: Don't crash when creating the config object fails
As observed when building in a chroot and QEMU_USER doesn't exist
This commit is contained in:
parent
ed1b5d8e8d
commit
ff32ac06f5
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user