mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 11:52:20 +00:00
Properly unref a connection with a close callback
The connection pointer in the closeCallback data was never initialized, making the unref in remoteClientCloseFunc a no-op. This fixes the following leak in virsh when the daemon closes the connection unexpectedly: 1,179 (288 direct, 891 indirect) bytes in 1 blocks are definitely lost in loss record 745 of 792 at 0x4C2A6D0: calloc (in vgpreload_memcheck-amd64-linux.so) by 0x4E9643D: virAllocVar (viralloc.c:558) by 0x4ED2425: virObjectNew (virobject.c:190) by 0x4F675AC: virGetConnect (datatypes.c:116) by 0x4F6EA06: do_open (libvirt.c:1136) by 0x4F71017: virConnectOpenAuth (libvirt.c:1481) by 0x129FFA: vshReconnect (virsh.c:337) by 0x128310: main (virsh.c:2470)
This commit is contained in:
parent
6385283add
commit
e68432e45f
@ -21455,6 +21455,7 @@ int virConnectRegisterCloseCallback(virConnectPtr conn,
|
||||
goto error;
|
||||
}
|
||||
|
||||
conn->closeCallback->conn = conn;
|
||||
conn->closeCallback->callback = cb;
|
||||
conn->closeCallback->opaque = opaque;
|
||||
conn->closeCallback->freeCallback = freecb;
|
||||
|
Loading…
x
Reference in New Issue
Block a user