]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: Don't leak reference to virQEMUDriverConfigPtr
authorJiri Denemark <jdenemar@redhat.com>
Fri, 27 Sep 2013 13:07:38 +0000 (15:07 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 27 Sep 2013 13:57:14 +0000 (15:57 +0200)
commit833cdab6d2ad7521c954948adf3c7d3c3b42ae9f
tree837c8f94136dbff7f38ad5eb7145fa8c04709757
parent9940392c2fe25c5c6afe19bb92ce89b3b2a056f7
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: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_process.c