From: Cole Robinson Date: Fri, 8 Jan 2016 19:46:48 +0000 (-0500) Subject: qemu: Fix crash when defining XML with bogus emulator X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3d92a000ff51225b3afb4dbb83e58e4446f9b035;p=libvirt.git qemu: Fix crash when defining XML with bogus emulator We weren't checking for failure of qemuCaps lookup --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 00c780d841..97534c0146 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1247,7 +1247,9 @@ qemuDomainDefPostParse(virDomainDefPtr def, !(def->emulator = virDomainDefGetDefaultEmulator(def, caps))) return ret; - qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator); + if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, + def->emulator))) + goto cleanup; if (qemuDomainDefAddDefaultDevices(def, qemuCaps) < 0) goto cleanup;