diff options
author | John Ferlan <jferlan@redhat.com> | 2014-08-28 12:49:30 -0400 |
---|---|---|
committer | John Ferlan <jferlan@redhat.com> | 2014-08-28 19:18:52 -0400 |
commit | 5c0dad7b39c3e52a2336ae0e7c982bb0c6da250d (patch) | |
tree | ced0a33aefe0e144092a2688309eb33c28a0a02d | |
parent | e387f4c1f15e2e1a4582d7751c6f9d4dfef4b5ce (diff) | |
download | libvirt-5c0dad7b39c3e52a2336ae0e7c982bb0c6da250d.tar.gz |
qemu_driver: Resolve Coverity FORWARD_NULLv1.2.8-rc2
In qemuDomainSnapshotCreateDiskActive() if we jumped to cleanup from a
failed actions = virJSONValueNewArray(), then 'cfg' would be NULL.
So just return -1, which in turn removes the need for cleanup:
-rw-r--r-- | src/qemu/qemu_driver.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5d2108092b..239a3009ed 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13023,7 +13023,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION)) { if (!(actions = virJSONValueNewArray())) - goto cleanup; + return -1; } else if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DISK_SNAPSHOT)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("live disk snapshot not supported with this " @@ -13106,7 +13106,6 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, } } - cleanup: /* recheck backing chains of all disks involved in the snapshot */ orig_err = virSaveLastError(); for (i = 0; i < snap->def->ndisks; i++) { |