[libvirt] [PATCH 1/6] conf: Plug memory leak on virDomainDefParseXML() error path

ajia at redhat.com ajia at redhat.com
Wed Nov 30 05:57:07 UTC 2011


From: Alex Jia <ajia at redhat.com>

Detected by Coverity. Leak introduced in commit 0873b68.

Signed-off-by: Alex Jia <ajia at redhat.com>
---
 src/conf/domain_conf.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d50a5c7..1559de2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7468,6 +7468,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;
             }
 
-- 
1.7.1




More information about the libvir-list mailing list