From: Alex Jia Date: Wed, 30 Nov 2011 05:57:07 +0000 (+0800) Subject: conf: Plug memory leak on virDomainDefParseXML() error path X-Git-Tag: v0.9.8-rc1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad8fa356a6c444b616d85bf44635c2c275526fac;p=thirdparty%2Flibvirt.git conf: Plug memory leak on virDomainDefParseXML() error path Detected by Coverity. Leak introduced in commit 0873b68. Signed-off-by: Alex Jia --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d1f8a76db1..75f21dc6c7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7540,6 +7540,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps, if (i != 0) { virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Only the first console can be a serial port")); + virDomainChrDefFree(chr); goto error; }