]> git.ipfire.org Git - thirdparty/libvirt.git/commit
remote: Fix memory leak in remoteConnectGetAllDomainStats
authorPeter Krempa <pkrempa@redhat.com>
Wed, 5 Nov 2014 11:34:51 +0000 (12:34 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 5 Nov 2014 15:18:09 +0000 (16:18 +0100)
commitbf1f8e280c330f51833189d40a99dc894205a129
treeb554d3d77fa630ff19d55a8ec9b088ee6d0c5a24
parentd426431fde106dcf749b110ba221fd37e91c04b9
remote: Fix memory leak in remoteConnectGetAllDomainStats

The remote call actually doesn't free the arguments array so we leak
memory in case a domain list is specified. As the remote domain list
array consists only of stolen pointers from the actual domain objects
it's sufficient just to free the array.

Valgrind message:
==1081452== 64 bytes in 1 blocks are definitely lost in loss record 632 of 726
==1081452==    at 0x4C296D0: calloc (vg_replace_malloc.c:618)
==1081452==    by 0x4EA5CB4: virAllocN (viralloc.c:191)
==1081452==    by 0x505D21E: remoteConnectGetAllDomainStats (remote_driver.c:7785)
==1081452==    by 0x50081AA: virDomainListGetStats (libvirt-domain.c:11080)
==1081452==    by 0x155249: cmdDomstats (virsh-domain-monitor.c:2147)
==1081452==    by 0x12FB73: vshCommandRun (virsh.c:1935)
==1081452==    by 0x133FEB: main (virsh.c:3719)
src/remote/remote_driver.c