提交 b5212365 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 597fdabb
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册