mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Fix reference leak in qemuDomainDefPostParse
The function gets a reference on virQEMUDriverConfig which needs to be released before returning. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
cf32a69ae1
commit
0b224cce8b
@ -2134,13 +2134,13 @@ qemuDomainDefPostParse(virDomainDefPtr def,
|
|||||||
if (def->os.bootloader || def->os.bootloaderArgs) {
|
if (def->os.bootloader || def->os.bootloaderArgs) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("bootloader is not supported by QEMU"));
|
_("bootloader is not supported by QEMU"));
|
||||||
return ret;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!def->os.machine) {
|
if (!def->os.machine) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("missing machine type"));
|
_("missing machine type"));
|
||||||
return ret;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (def->os.loader &&
|
if (def->os.loader &&
|
||||||
@ -2155,7 +2155,7 @@ qemuDomainDefPostParse(virDomainDefPtr def,
|
|||||||
/* check for emulator and create a default one if needed */
|
/* check for emulator and create a default one if needed */
|
||||||
if (!def->emulator &&
|
if (!def->emulator &&
|
||||||
!(def->emulator = virDomainDefGetDefaultEmulator(def, caps)))
|
!(def->emulator = virDomainDefGetDefaultEmulator(def, caps)))
|
||||||
return ret;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
|
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
|
||||||
def->emulator)))
|
def->emulator)))
|
||||||
|
Loading…
Reference in New Issue
Block a user