diff options
author | 2010-05-17 12:10:52 +0200 | |
---|---|---|
committer | 2010-05-26 11:54:04 -0500 | |
commit | c2ae536c53d6969f0e06d04b63ed1f419bfa8580 (patch) | |
tree | 45ff3fda7077e8b8b0b7b5419a5d1fb19070b164 | |
parent | Release of libvirt-0.8.1 (diff) | |
download | libvirt-c2ae536c53d6969f0e06d04b63ed1f419bfa8580.tar.gz libvirt-c2ae536c53d6969f0e06d04b63ed1f419bfa8580.tar.bz2 libvirt-c2ae536c53d6969f0e06d04b63ed1f419bfa8580.zip |
qemu_driver: avoid NULL dereference
* src/qemu/qemu_driver.c (qemudDomainStart): After setting vm to NULL,
goto cleanup, rather than dereferencing the NULL pointer.
-rw-r--r-- | src/qemu/qemu_driver.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 08cff00d8..5db2f596d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6397,8 +6397,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); |