[PATCH 1/5] qemuBackupBegin: Don't leak 'def' on early failures

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

 



The cleanup path expects that 'def' is assigned to 'priv->backup', but
that's not the case for early failures. Add a check to stop overwriting
of 'def' so that it can be freed.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_backup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index db8b2d8ff9..531005425b 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -806,7 +806,7 @@ qemuBackupBegin(virDomainObjPtr vm,
         ignore_value(qemuDomainObjExitMonitor(priv->driver, vm));
     }

-    if (ret < 0 && !job_started)
+    if (ret < 0 && !job_started && priv->backup)
         def = g_steal_pointer(&priv->backup);

     if (ret == 0)
-- 
2.26.2




[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]

  Powered by Linux