>From 6d0e0e571bba7792df9dacb898849708d5d3b425 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@xxxxxxxxxx> 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 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 766993c..306776d 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; -- 1.7.0.rc1.199.g9253a -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list