libvirt/tools
Alex Jia 1768bf63ed virsh: fix memory leak in cmdVolPath code
* tools/virsh.c: avoid memory leak in cmdVolPath.
* src/libvirt.c: Add doc for virStorageVolGetPath to tell one
  must free() the returned path after use.

* how to reproduce?

% dd if=/dev/zero of=/var/lib/libvirt/images/foo.img count=1 bs=10M
% virsh pool-refresh default
% valgrind -v --leak-check=full virsh vol-path --vol \
/var/lib/libvirt/images/foo.img

* actual results:

Detected in valgrind run:

==16436== 32 bytes in 1 blocks are definitely lost in loss record 7 of 22
==16436==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==16436==    by 0x386A314B3D: xdr_string (in /lib64/libc-2.12.so)
==16436==    by 0x3DF8CD770D: xdr_remote_nonnull_string (remote_protocol.c:3
==16436==    by 0x3DF8CD7EC8: xdr_remote_storage_vol_get_path_ret
% virsh pool-refresh default
% valgrind -v --leak-check=full virsh vol-path --vol \
/var/lib/libvirt/images/foo.img

Signed-off-by: Alex Jia <ajia@redhat.com>
2011-07-28 10:42:51 +08:00
..
.gitignore Support automatic creation of leases for disks in sanlock 2011-06-28 18:18:06 +01:00
console.c build: rename files.h to virfile.h 2011-07-21 10:34:51 -06:00
console.h Re-write virsh console to use streams 2010-11-11 16:03:20 +00:00
libvirt_win_icon_16x16.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_32x32.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_48x48.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_64x64.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt-guests.init.sh save: support bypass-cache flag in libvirt-guests init script 2011-07-21 16:24:09 -06:00
libvirt-guests.sysconf save: support bypass-cache flag in libvirt-guests init script 2011-07-21 16:24:09 -06:00
Makefile.am build: avoid pod2man on tarball 2011-06-29 09:12:41 -06:00
virsh_win_icon.rc Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
virsh.c virsh: fix memory leak in cmdVolPath code 2011-07-28 10:42:51 +08:00
virsh.pod virsh: expose change-protection during migration 2011-07-27 15:19:32 -06:00
virt-pki-validate.in virt-*-validate.in: quote all variable references 2011-02-21 10:32:34 -07:00
virt-sanlock-cleanup.in Support automatic creation of leases for disks in sanlock 2011-06-28 18:18:06 +01:00
virt-xml-validate.in virt-*-validate.in: quote all variable references 2011-02-21 10:32:34 -07:00