From ad8fa356a6c444b616d85bf44635c2c275526fac Mon Sep 17 00:00:00 2001 From: Alex Jia Date: Wed, 30 Nov 2011 13:57:07 +0800 Subject: [PATCH] conf: Plug memory leak on virDomainDefParseXML() error path Detected by Coverity. Leak introduced in commit 0873b68. Signed-off-by: Alex Jia --- 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 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; }