提交 833cdab6 编写于 作者: J Jiri Denemark

qemu: Don't leak reference to virQEMUDriverConfigPtr

https://bugzilla.redhat.com/show_bug.cgi?id=1011330 (case D)

qemuProcessStart created two references to virQEMUDriverConfigPtr before
calling fork():

    cfg = virQEMUDriverGetConfig(driver);
    ...
    hookData.cfg = virObjectRef(cfg);

However, the child only unreferenced hookData.cfg and the parent only
removed the cfg reference. That said, we don't need to increment the
reference counter when assigning cfg to hookData. Both the child and the
parent will correctly remove the reference on cfg (the child will do
that through hookData).
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 9940392c
......@@ -3520,7 +3520,8 @@ int qemuProcessStart(virConnectPtr conn,
hookData.conn = conn;
hookData.vm = vm;
hookData.driver = driver;
hookData.cfg = virObjectRef(cfg);
/* We don't increase cfg's reference counter here. */
hookData.cfg = cfg;
VIR_DEBUG("Beginning VM startup process");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册