From: Daniel P. Berrange Date: Fri, 23 Nov 2012 16:40:16 +0000 (+0000) Subject: Ensure transient def is removed if LXC start fails X-Git-Tag: CVE-2012-3411~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d2bfc1ca78eb7106e5d189b9d21ad47e1826e50;p=thirdparty%2Flibvirt.git Ensure transient def is removed if LXC start fails When starting a container, newDef is initialized to a copy of 'def', but when startup fails newDef is never removed. This cause later attempts to use 'virDomainDefine' to lose the new data being defined. Signed-off-by: Daniel P. Berrange --- diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 6cfbb0df57..28eecec1aa 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -1199,6 +1199,10 @@ cleanup: VIR_FREE(veths[i]); } if (rc != 0) { + if (vm->newDef) { + virDomainDefFree(vm->newDef); + vm->newDef = NULL; + } if (priv->monitor) { virObjectUnref(priv->monitor); priv->monitor = NULL;