qemudDomainSetVcpus: avoid NULL-deref on failed uuid look-up

* src/qemu/qemu_driver.c (qemudDomainSetVcpus): Upon look-up failure,
i.e., vm==NULL, goto cleanup, rather than to "endjob", superficially
since the latter would dereference vm, but more fundamentally because
we certainly don't want to call qemuDomainObjEndJob before we've
even attempted qemuDomainObjBeginJob.
This commit is contained in:
Jim Meyering 2010-05-17 19:28:44 +02:00
parent 93fedcf20f
commit 20701b17e2

View File

@ -5530,7 +5530,7 @@ static int qemudDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) {
virUUIDFormat(dom->uuid, uuidstr);
qemuReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching uuid '%s'"), uuidstr);
goto endjob;
goto cleanup;
}
if (qemuDomainObjBeginJob(vm) < 0)