[PATCH] qemu: Fix reference leak in qemuDomainDefPostParse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The function gets a reference on virQEMUDriverConfig which needs to be
released before returning.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 29f6b93..8f19fb5 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2134,13 +2134,13 @@ qemuDomainDefPostParse(virDomainDefPtr def,
     if (def->os.bootloader || def->os.bootloaderArgs) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                        _("bootloader is not supported by QEMU"));
-        return ret;
+        goto cleanup;
     }
 
     if (!def->os.machine) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("missing machine type"));
-        return ret;
+        goto cleanup;
     }
 
     if (def->os.loader &&
@@ -2155,7 +2155,7 @@ qemuDomainDefPostParse(virDomainDefPtr def,
     /* check for emulator and create a default one if needed */
     if (!def->emulator &&
         !(def->emulator = virDomainDefGetDefaultEmulator(def, caps)))
-        return ret;
+        goto cleanup;
 
     if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
                                             def->emulator)))
-- 
2.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]