提交 773f923e 编写于 作者: P Peter Krempa

qemu: blockjob: Don't leak 'cfg' from qemuBlockJobEventProcessLegacy

Since c2573527 a reference of 'cfg' would be leaked if the function
does not need to process anything. Fix it by using VIR_AUTOUNREF.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 cf146eb0
......@@ -315,7 +315,7 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,
qemuBlockJobDataPtr job,
int asyncJob)
{
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
virDomainDiskDefPtr disk = job->disk;
VIR_DEBUG("disk=%s, mirrorState=%s, type=%d, state=%d, newstate=%d",
......@@ -368,8 +368,6 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,
VIR_WARN("Unable to update persistent definition on vm %s "
"after block job", vm->def->name);
}
virObjectUnref(cfg);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册