On Thu, Feb 04, 2010 at 12:50:09PM +0100, Jim Meyering wrote:
>From 6d0e0e571bba7792df9dacb898849708d5d3b425 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
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;
--
ACK
Daniel
--
|: Red Hat, Engineering, London -o-
http://people.redhat.com/berrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org -o-
http://ovirt.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|