mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
qemuBackupBegin: Don't leak 'def' on early failures
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
597fdabbc0
commit
b5212365b6
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user