Hide Forgot
Description of problem: Allocate memory to def->redirdevs in virDomainDefParseXML function such as VIR_ALLOC_N(def->redirdevs, n), however, virDomainDefFree(def) function hasn't released these memory. Version-Release number of selected component (if applicable): Libvirt upstream. How reproducible: Always. Steps to Reproduce: 1. ./configure && make && make check all 2. valgrind -v --leak-check=full ./tests/qemuxml2xmltest Actual results: Detected in valgrind run: ==19820== 209 (16 direct, 193 indirect) bytes in 1 blocks are definitely lost in loss record 25 of 26 ==19820== at 0x4A04A28: calloc (vg_replace_malloc.c:467) ==19820== by 0x4A13AF: virAllocN (memory.c:129) ==19820== by 0x4D4A0E: virDomainDefParseXML (domain_conf.c:7258) ==19820== by 0x4D4C93: virDomainDefParseNode (domain_conf.c:7512) ==19820== by 0x4D562F: virDomainDefParse (domain_conf.c:7465) ==19820== by 0x415863: testCompareXMLToXMLFiles (qemuxml2xmltest.c:35) ==19820== by 0x415982: testCompareXMLToXMLHelper (qemuxml2xmltest.c:80) ==19820== by 0x416D31: virtTestRun (testutils.c:140) ==19820== by 0x415604: mymain (qemuxml2xmltest.c:192) ==19820== by 0x416437: virtTestMain (testutils.c:689) ==19820== by 0x3CA7A1ECDC: (below main) (in /lib64/libc-2.12.so) ==19820== ==19820== LEAK SUMMARY: ==19820== definitely lost: 16 bytes in 1 blocks ==19820== indirectly lost: 193 bytes in 5 blocks ==19820== possibly lost: 0 bytes in 0 blocks ==19820== still reachable: 1,054 bytes in 21 blocks Expected results: Avoid memory leak. Additional info:
Patch for upstream: http://www.redhat.com/archives/libvir-list/2011-September/msg00625.html Alex
This leak is not present in RHEL 6.2, since we did not backport redirdevs there. RHEL 6.3 will rebase, and pick up the upstream patch; so I'm closing this now.