]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virNetServerServiceClose: Don't leak sockets
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Jun 2015 12:37:43 +0000 (14:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 19 Jun 2015 09:19:50 +0000 (11:19 +0200)
commit355d8f470f92f10587bb84709fddb706efdb4dee
tree29fcf9bf00d64b93ecdf2bb56d048de9629b26c1
parent9ee5a79830011cb9cf9b09d388becb59a88a5c20
virNetServerServiceClose: Don't leak sockets

Well, if a server is being destructed, all underlying services and
their sockets should disappear with it. But due to bug in our
implementation this is not the case. Yes, we are closing the sockets,
but that's not enough. We must also:

1) Unregister them from the event loop
2) Unref the service for each socket

The last step is needed, because each socket callback holds a
reference to the service object. Since in the first step we are
unregistering the callbacks, they no longer need the reference.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/rpc/virnetserverservice.c