mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Resolve Coverity NEGATIVE_RETURNS
Coverity notes that if the virConnectListAllDomains returns a negative value then the loop at the cleanup label that ends on numDomains will have issues. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
b74a3fb307
commit
81a8fc34ad
@ -1004,9 +1004,11 @@ qemuStateStop(void)
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
if (domains) {
|
||||||
for (i = 0; i < numDomains; i++)
|
for (i = 0; i < numDomains; i++)
|
||||||
virDomainFree(domains[i]);
|
virDomainFree(domains[i]);
|
||||||
VIR_FREE(domains);
|
VIR_FREE(domains);
|
||||||
|
}
|
||||||
VIR_FREE(flags);
|
VIR_FREE(flags);
|
||||||
virObjectUnref(conn);
|
virObjectUnref(conn);
|
||||||
virObjectUnref(cfg);
|
virObjectUnref(cfg);
|
||||||
|
Loading…
Reference in New Issue
Block a user