]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
rpc: don't unref service ref on socket behalf twice
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Thu, 9 Jul 2020 07:59:33 +0000 (10:59 +0300)
committerNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Mon, 7 Sep 2020 06:33:58 +0000 (09:33 +0300)
Second unref was added in [1]. We don't need it actually as
we pass free callback to virNetSocketAddIOCallback thus
when we call virNetSocketRemoveIOCallback the extra ref for
callback will be dropped without extra efforts.

[1] 355d8f470f9: virNetServerServiceClose: Don't leak sockets

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/rpc/virnetserverservice.c

index 9d5df456a85ae2e456b77e63ff44f365bd55af9e..e4165eacb78c11f4e8f157ac02383ae603bd1774 100644 (file)
@@ -449,6 +449,5 @@ void virNetServerServiceClose(virNetServerServicePtr svc)
     for (i = 0; i < svc->nsocks; i++) {
         virNetSocketRemoveIOCallback(svc->socks[i]);
         virNetSocketClose(svc->socks[i]);
-        virObjectUnref(svc);
     }
 }