mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
Fix memory leak in testDomainCreateXMLMixed()
While running objecteventtest, it was found that valgrind pointed out the following memory leak: ==125== 538 (56 direct, 482 indirect) bytes in 1 blocks are definitely lost in loss record 216 of 226 ==125== at 0x4A06B6F: calloc (vg_replace_malloc.c:593) ==125== by 0x4C65D8D: virAllocVar (viralloc.c:558) ==125== by 0x4C9F055: virObjectNew (virobject.c:190) ==125== by 0x4D2B2E8: virGetDomain (datatypes.c:220) ==125== by 0x4D79180: testDomainDefineXML (test_driver.c:2962) ==125== by 0x4D4977D: virDomainDefineXML (libvirt.c:8512) ==125== by 0x4029C2: testDomainCreateXMLMixed (objecteventtest.c:226) ==125== by 0x403A21: virtTestRun (testutils.c:138) ==125== by 0x4021C2: mymain (objecteventtest.c:549) ==125== by 0x4040C2: virtTestMain (testutils.c:593) ==125== by 0x341F421A04: (below main) (libc-start.c:225) Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
066c8ef6c1
commit
b22f772610
@ -245,6 +245,10 @@ testDomainCreateXMLMixed(const void *data)
|
||||
if (id2 < 0)
|
||||
goto cleanup;
|
||||
|
||||
virDomainUndefine(dom);
|
||||
virDomainDestroy(dom);
|
||||
virDomainFree(dom);
|
||||
|
||||
dom = virDomainCreateXML(test->conn, domainDef, 0);
|
||||
if (dom == NULL || virEventRunDefaultImpl() < 0)
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user