[libvirt] [PATCH] Fix potential double free in virDomainObjParseXML()

--- 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 6a8fd5d..8730f37 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3493,6 +3493,7 @@ static virDomainObjPtr virDomainObjParseXML(virConnectPtr conn, error: VIR_FREE(nodes); virDomainChrDefFree(obj->monitor_chr); + obj->monitor_chr = NULL; virDomainObjUnref(obj); return NULL; } -- 1.6.0.4

On Sun, Dec 06, 2009 at 11:03:13PM +0100, Matthias Bolte wrote:
--- 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 6a8fd5d..8730f37 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3493,6 +3493,7 @@ static virDomainObjPtr virDomainObjParseXML(virConnectPtr conn, error: VIR_FREE(nodes); virDomainChrDefFree(obj->monitor_chr); + obj->monitor_chr = NULL; virDomainObjUnref(obj); return NULL; }
ACK Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

2009/12/8 Daniel Veillard <veillard@redhat.com>:
On Sun, Dec 06, 2009 at 11:03:13PM +0100, Matthias Bolte wrote:
--- 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 6a8fd5d..8730f37 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3493,6 +3493,7 @@ static virDomainObjPtr virDomainObjParseXML(virConnectPtr conn, error: VIR_FREE(nodes); virDomainChrDefFree(obj->monitor_chr); + obj->monitor_chr = NULL; virDomainObjUnref(obj); return NULL; }
ACK
Daniel
This patch is obsolete now, because Daniel Berrange pushed his QEMU monitor patch series that moved the monitor_chr part to the QEMU driver. Matthias
participants (2)
-
Daniel Veillard
-
Matthias Bolte