]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemudDomainSetVcpus: avoid NULL-deref on failed uuid look-up
authorJim Meyering <meyering@redhat.com>
Mon, 17 May 2010 17:28:44 +0000 (19:28 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 18 May 2010 05:53:42 +0000 (07:53 +0200)
* 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.

src/qemu/qemu_driver.c

index 3eb942c6ac643a10c65bb7de3b20d76357e2157c..948ab5b4173a46b46bd3a35dc39c73660975a78d 100644 (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)