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
This commit is contained in:
Peter Krempa 2016-04-07 12:50:15 +02:00
parent be6e92f541
commit 03e8d5fb54

View File

@ -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);