mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
conf: Add cleanup label to virDomainDefParse
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
5ae24a13c7
commit
9bcbc52ef1
@ -21517,16 +21517,18 @@ virDomainDefParse(const char *xmlStr,
|
|||||||
void *parseOpaque,
|
void *parseOpaque,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
xmlDocPtr xml;
|
xmlDocPtr xml = NULL;
|
||||||
virDomainDefPtr def = NULL;
|
virDomainDefPtr def = NULL;
|
||||||
int keepBlanksDefault = xmlKeepBlanksDefault(0);
|
int keepBlanksDefault = xmlKeepBlanksDefault(0);
|
||||||
|
|
||||||
if ((xml = virXMLParse(filename, xmlStr, _("(domain_definition)")))) {
|
if (!(xml = virXMLParse(filename, xmlStr, _("(domain_definition)"))))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
def = virDomainDefParseNode(xml, xmlDocGetRootElement(xml), caps,
|
def = virDomainDefParseNode(xml, xmlDocGetRootElement(xml), caps,
|
||||||
xmlopt, parseOpaque, flags);
|
xmlopt, parseOpaque, flags);
|
||||||
xmlFreeDoc(xml);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
xmlFreeDoc(xml);
|
||||||
xmlKeepBlanksDefault(keepBlanksDefault);
|
xmlKeepBlanksDefault(keepBlanksDefault);
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user