From 20701b17e22e55a93d7aa94ea2611a58b1f27c04 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 17 May 2010 19:28:44 +0200 Subject: [PATCH] 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. --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3eb942c6ac..948ab5b417 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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) -- GitLab