]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Fix memory leak in virQEMUCapsLoadCPUModels
authorMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Fri, 27 Oct 2017 07:53:03 +0000 (09:53 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 27 Oct 2017 08:13:43 +0000 (10:13 +0200)
commita50b45a2971a4c70f005a8e8821ea7a794e87e7b
tree34b4a86de27402879154c2e65d96c998e6098710
parent418a100290ffe7f3ce944af719b495eff9d2acb5
qemu: Fix memory leak in virQEMUCapsLoadCPUModels

Don't leak @blockNodes in the loop.

==226576== 7,120 bytes in 60 blocks are definitely lost in loss record 122 of 125
==226576==    at 0x4835214: calloc (vg_replace_malloc.c:711)
==226576==    by 0x4950D7B: virAllocN (viralloc.c:191)
==226576==    by 0x49EB5BB: virXPathNodeSet (virxml.c:676)
==226576==    by 0x104DB67: virQEMUCapsLoadCPUModels (qemu_capabilities.c:3738)
==226576==    by 0x105510D: virQEMUCapsLoadCache (qemu_capabilities.c:3929)
==226576==    by 0x104459F: qemuTestParseCapabilities (testutilsqemu.c:498)
==226576==    by 0x1040DC9: testQemuCapsCopy (qemucapabilitiestest.c:105)
==226576==    by 0x1041F07: virTestRun (testutils.c:180)
==226576==    by 0x1040B45: mymain (qemucapabilitiestest.c:181)
==226576==    by 0x104320F: virTestMain (testutils.c:1119)
==226576==    by 0x1041149: main (qemucapabilitiestest.c:193)

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_capabilities.c