On Tue, Jul 14, 2020 at 12:32:55PM +0300, Nikolay Shirokovskiy wrote:
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.
Oh, so this is actually fixing unref of free'd memory. Surprised we
don't crash in this already.
[1] 355d8f470f9: virNetServerServiceClose: Don't leak sockets
---
src/rpc/virnetserverservice.c | 1 -
1 file changed, 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <berrange(a)redhat.com>
diff --git a/src/rpc/virnetserverservice.c
b/src/rpc/virnetserverservice.c
index 9d5df45..e4165ea 100644
--- a/src/rpc/virnetserverservice.c
+++ b/src/rpc/virnetserverservice.c
@@ -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);
}
}
--
1.8.3.1
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|