提交 b22f7726 编写于 作者: N Nehal J Wani 提交者: Ján Tomko

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: NJán Tomko <jtomko@redhat.com>
上级 066c8ef6
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册