mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
virDomainChrDefParseXML: don't leak upon invalid input
* src/conf/domain_conf.c (virDomainChrDefParseXML): Don't leak a virDomainChrDef buffer upon "unknown target type for char device" error.
This commit is contained in:
parent
6eed3feafb
commit
04ebf058d5
@ -1947,6 +1947,7 @@ virDomainChrDefParseXML(virConnectPtr conn,
|
||||
virDomainReportError(conn, VIR_ERR_XML_ERROR,
|
||||
_("unknown target type for character device: %s"),
|
||||
nodeName);
|
||||
VIR_FREE(def);
|
||||
return NULL;
|
||||
}
|
||||
def->targetType = VIR_DOMAIN_CHR_TARGET_TYPE_NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user