aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-05-17 19:28:44 +0200
committerDoug Goldstein <cardoe@gentoo.org>2010-05-26 11:58:11 -0500
commit24425d95a6ece3b492f82b88dd54ea4406eb8119 (patch)
treea86a261e703cebb081f53a965eac992df01ba41a
parentx86ModelHasFeature: avoid NULL-dereference for unmatched CPU "feature" (diff)
downloadlibvirt-24425d95a6ece3b492f82b88dd54ea4406eb8119.tar.gz
libvirt-24425d95a6ece3b492f82b88dd54ea4406eb8119.tar.bz2
libvirt-24425d95a6ece3b492f82b88dd54ea4406eb8119.zip
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.
-rw-r--r--src/qemu/qemu_driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 7b9fb4d31..e8fe37b67 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5436,7 +5436,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)