]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Properly unref a connection with a close callback
authorJán Tomko <jtomko@redhat.com>
Thu, 14 Nov 2013 15:29:29 +0000 (16:29 +0100)
committerJán Tomko <jtomko@redhat.com>
Mon, 18 Nov 2013 11:26:15 +0000 (12:26 +0100)
commite68432e45fcfbd3fd65532d0213f0a3b57925fae
tree03933ed077c6c74a85dd9d4c59a2c4a2d105191a
parent6385283add679bfe2d411362dcb0b80ef928e9f4
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)
src/libvirt.c