mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
Fix memory leak in virDomainDefParseXML()
This patch fixes the memory leaks found while running qemuxml2argvtest ==8260== 3 bytes in 1 blocks are definitely lost in loss record 1 of 129 ==8260== at 0x4A0887C: malloc (vg_replace_malloc.c:270) ==8260== by 0x341F485E21: strdup (strdup.c:42) ==8260== by 0x4CADCFF: virStrdup (virstring.c:554) ==8260== by 0x4CBB839: virXPathString (virxml.c:90) ==8260== by 0x4CE753A: virDomainDefParseXML (domain_conf.c:11478) ==8260== by 0x4CEB4FE: virDomainDefParseNode (domain_conf.c:12742) ==8260== by 0x4CEB675: virDomainDefParse (domain_conf.c:12684) ==8260== by 0x425958: testCompareXMLToArgvHelper (qemuxml2argvtest.c:107) ==8260== by 0x427111: virtTestRun (testutils.c:138) ==8260== by 0x41D3FE: mymain (qemuxml2argvtest.c:452) ==8260== by 0x4277B2: virtTestMain (testutils.c:593) ==8260== by 0x341F421A04: (below main) (libc-start.c:225) ==8260== ==8260== 4 bytes in 1 blocks are definitely lost in loss record 5 of 129 ==8260== at 0x4A0887C: malloc (vg_replace_malloc.c:270) ==8260== by 0x341F485E21: strdup (strdup.c:42) ==8260== by 0x4CADCFF: virStrdup (virstring.c:554) ==8260== by 0x4CBB839: virXPathString (virxml.c:90) ==8260== by 0x4CE753A: virDomainDefParseXML (domain_conf.c:11478) ==8260== by 0x4CEB4FE: virDomainDefParseNode (domain_conf.c:12742) ==8260== by 0x4CEB675: virDomainDefParse (domain_conf.c:12684) ==8260== by 0x425958: testCompareXMLToArgvHelper (qemuxml2argvtest.c:107) ==8260== by 0x427111: virtTestRun (testutils.c:138) ==8260== by 0x41D39A: mymain (qemuxml2argvtest.c:451) ==8260== by 0x4277B2: virtTestMain (testutils.c:593) ==8260== by 0x341F421A04: (below main) (libc-start.c:225) ==8260==
This commit is contained in:
parent
77b97d800c
commit
2cfcd2ccd0
@ -11482,6 +11482,7 @@ virDomainDefParseXML(xmlDocPtr xml,
|
||||
tmp, virDomainFeatureTypeToString(val));
|
||||
goto error;
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
} else {
|
||||
def->features[val] = VIR_DOMAIN_FEATURE_STATE_ON;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user