mirror of https://gitee.com/openkylin/libvirt.git
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: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
6b6e2cf92b
commit
958d6208a3
|
@ -265,6 +265,8 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||||
size_t i;
|
size_t i;
|
||||||
qemuDomainObjPrivatePtr priv = NULL;
|
qemuDomainObjPrivatePtr priv = NULL;
|
||||||
|
|
||||||
|
memset(&monitor_chr, 0, sizeof(monitor_chr));
|
||||||
|
|
||||||
if (!(conn = virGetConnect()))
|
if (!(conn = virGetConnect()))
|
||||||
goto out;
|
goto out;
|
||||||
conn->secretDriver = &fakeSecretDriver;
|
conn->secretDriver = &fakeSecretDriver;
|
||||||
|
@ -292,8 +294,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||||
|
|
||||||
vm->def->id = -1;
|
vm->def->id = -1;
|
||||||
|
|
||||||
|
|
||||||
memset(&monitor_chr, 0, sizeof(monitor_chr));
|
|
||||||
if (qemuProcessPrepareMonitorChr(&monitor_chr, priv->libDir) < 0)
|
if (qemuProcessPrepareMonitorChr(&monitor_chr, priv->libDir) < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@ -363,6 +363,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||||
out:
|
out:
|
||||||
VIR_FREE(log);
|
VIR_FREE(log);
|
||||||
VIR_FREE(actualargv);
|
VIR_FREE(actualargv);
|
||||||
|
virDomainChrSourceDefClear(&monitor_chr);
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
virObjectUnref(vm);
|
virObjectUnref(vm);
|
||||||
virObjectUnref(conn);
|
virObjectUnref(conn);
|
||||||
|
|
Loading…
Reference in New Issue