Commit Graph

2 Commits

Author SHA1 Message Date
Nehal J Wani
4154c4e91d Fix memory leak in testGetCaps()
While running qemucaps2xmltest, it was found that valgrind pointed out
the following memory leaks:

==27045== 160 (112 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 51 of 65
==27045==    at 0x4A0577B: calloc (vg_replace_malloc.c:593)
==27045==    by 0x4C6BACD: virAllocVar (viralloc.c:560)
==27045==    by 0x4CAF095: virObjectNew (virobject.c:193)
==27045==    by 0x421453: virQEMUCapsNew (qemu_capabilities.c:1805)
==27045==    by 0x41F04F: testQemuCapsXML (qemucaps2xmltest.c:72)
==27045==    by 0x41FFD1: virtTestRun (testutils.c:201)
==27045==    by 0x41EE7A: mymain (qemucaps2xmltest.c:203)
==27045==    by 0x42074D: virtTestMain (testutils.c:789)
==27045==    by 0x3E6CE1ED1C: (below main) (libc-start.c:226)
==27045==
==27045== 160 (112 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 52 of 65
==27045==    at 0x4A0577B: calloc (vg_replace_malloc.c:593)
==27045==    by 0x4C6BACD: virAllocVar (viralloc.c:560)
==27045==    by 0x4CAF095: virObjectNew (virobject.c:193)
==27045==    by 0x421453: virQEMUCapsNew (qemu_capabilities.c:1805)
==27045==    by 0x41F04F: testQemuCapsXML (qemucaps2xmltest.c:72)
==27045==    by 0x41FFD1: virtTestRun (testutils.c:201)
==27045==    by 0x41EEA3: mymain (qemucaps2xmltest.c:204)
==27045==    by 0x42074D: virtTestMain (testutils.c:789)
==27045==    by 0x3E6CE1ED1C: (below main) (libc-start.c:226)
2014-03-27 07:22:10 +01:00
Francesco Romani
231b63e3ca qemu: add unit tests for the capabilities xml
The test is loosely inspired from qemucapabilitiestest
and qemuxml2xmltest.

Added a new test instead of extending an existing one because
the feature being tested don't really fits nicely in any
existing place.
2014-03-26 13:41:25 +01:00