From: Peter Krempa Date: Thu, 7 Apr 2016 10:50:15 +0000 (+0200) Subject: qemu: perf: Fix crash/memory corruption on failed VM start X-Git-Tag: v1.3.4-rc1~330 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03e8d5fb54c7c897225ed9ea56d83b894930f144;p=thirdparty%2Flibvirt.git qemu: perf: Fix crash/memory corruption on failed VM start The new perf code didn't bother to clear a pointer in 'priv' causing a double free or other memory corruption goodness if a VM failed to start. Clear the pointer after freeing the memory. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1324757 --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 2b600c138e..6c870f54f8 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3444,6 +3444,7 @@ qemuDomainPerfRestart(virDomainObjPtr vm) cleanup: virPerfFree(priv->perf); + priv->perf = NULL; return -1; } @@ -5970,6 +5971,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, virCgroupFree(&priv->cgroup); virPerfFree(priv->perf); + priv->perf = NULL; qemuProcessRemoveDomainStatus(driver, vm);