]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: Don't leak disk targets in cmdDomBlkError
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 13 May 2019 12:32:06 +0000 (14:32 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 13 May 2019 12:34:11 +0000 (14:34 +0200)
commitd55be92286f3b0143e263d42ce421d5c441f2cab
treec835ac42d4121c6816ea9b43fbaf9880e38ed5ce
parent89320788ac445948649facf76e90761ef0084276
virsh: Don't leak disk targets in cmdDomBlkError

The virDomainGetDiskErrors() API copies disk targets into @disks
array that we allocate. But we forgot to free it:

==140828== 16 bytes in 4 blocks are definitely lost in loss record 41 of 242
==140828==    at 0x4C2F08F: malloc (vg_replace_malloc.c:299)
==140828==    by 0x8C406D9: strdup (in /lib64/libc-2.28.so)
==140828==    by 0x5377DD3: virStrdup (virstring.c:966)
==140828==    by 0x54C112F: testDomainGetDiskErrors (test_driver.c:3068)
==140828==    by 0x55C863D: virDomainGetDiskErrors (libvirt-domain.c:10988)
==140828==    by 0x15D1FA: cmdDomBlkError (virsh-domain-monitor.c:1215)
==140828==    by 0x17F1A8: vshCommandRun (vsh.c:1335)
==140828==    by 0x13489E: main (virsh.c:920)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-domain-monitor.c