[libvirt] [PATCH 1/2] qemu: Don't leak reference to virQEMUDriverConfigPtr

Eric Blake eblake at redhat.com
Fri Sep 27 13:50:42 UTC 2013


On 09/27/2013 07:47 AM, Jiri Denemark wrote:
> 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 at redhat.com>
> ---
>  src/qemu/qemu_process.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130927/94472f36/attachment-0001.sig>


More information about the libvir-list mailing list