提交 0b224cce 编写于 作者: J Jiri Denemark

qemu: Fix reference leak in qemuDomainDefPostParse

The function gets a reference on virQEMUDriverConfig which needs to be
released before returning.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 cf32a69a
...@@ -2134,13 +2134,13 @@ qemuDomainDefPostParse(virDomainDefPtr def, ...@@ -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, ...@@ -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)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册