From 04ebf058d506c2a1a4bb1754726558410ff79270 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 4 Feb 2010 12:49:53 +0100 Subject: [PATCH] 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. --- src/conf/domain_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 766993c586..306776de1d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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; -- GitLab