diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fabd41b95c..5f1d6b59f4 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6489,8 +6489,11 @@ static int qemudDomainStart(virDomainPtr dom) { * We should still have a reference left to vm but * one should check for 0 anyway */ - if (qemuDomainObjEndJob(vm) == 0) + if (qemuDomainObjEndJob(vm) = 0) { vm = NULL; + goto cleanup; + } + virDomainObjUnlock(vm); qemuDriverUnlock(driver); ret = qemudDomainRestore(dom->conn, managed_save);