提交 958d6208 编写于 作者: M Michal Privoznik

qemuxml2argvtest: Don't leak dummy monitor

It's just test, but why leak it?

==26971== 20 bytes in 1 blocks are definitely lost in loss record 623 of 704
==26971==    at 0x4C29F80: malloc (vg_replace_malloc.c:296)
==26971==    by 0xE560447: vasprintf (vasprintf.c:76)
==26971==    by 0xAE0DEE2: virVasprintfInternal (virstring.c:480)
==26971==    by 0xAE0DFF7: virAsprintfInternal (virstring.c:501)
==26971==    by 0x4751F3: qemuProcessPrepareMonitorChr (qemu_process.c:2651)
==26971==    by 0x4334B1: testCompareXMLToArgvFiles (qemuxml2argvtest.c:297)
==26971==    by 0x4339AC: testCompareXMLToArgvHelper (qemuxml2argvtest.c:413)
==26971==    by 0x446E7A: virTestRun (testutils.c:179)
==26971==    by 0x445D33: mymain (qemuxml2argvtest.c:2029)
==26971==    by 0x44886F: virTestMain (testutils.c:969)
==26971==    by 0x445D9B: main (qemuxml2argvtest.c:2036)
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 6b6e2cf9
......@@ -265,6 +265,8 @@ static int testCompareXMLToArgvFiles(const char *xml,
size_t i;
qemuDomainObjPrivatePtr priv = NULL;
memset(&monitor_chr, 0, sizeof(monitor_chr));
if (!(conn = virGetConnect()))
goto out;
conn->secretDriver = &fakeSecretDriver;
......@@ -292,8 +294,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
vm->def->id = -1;
memset(&monitor_chr, 0, sizeof(monitor_chr));
if (qemuProcessPrepareMonitorChr(&monitor_chr, priv->libDir) < 0)
goto out;
......@@ -363,6 +363,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
out:
VIR_FREE(log);
VIR_FREE(actualargv);
virDomainChrSourceDefClear(&monitor_chr);
virCommandFree(cmd);
virObjectUnref(vm);
virObjectUnref(conn);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册