mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh-domain-monitor: Resolve Coverity issues
Recent changes uncovered a pair of NEGATIVE_RETURNS when processing the 'nnames' in 'vshDomainListCollect' in the for loop due to possible -1 value.
This commit is contained in:
@@ -1599,7 +1599,7 @@ finished:
|
||||
success = true;
|
||||
|
||||
cleanup:
|
||||
for (i = 0; i < nnames; i++)
|
||||
for (i = 0; nnames != -1 && i < nnames; i++)
|
||||
VIR_FREE(names[i]);
|
||||
|
||||
if (!success) {
|
||||
|
||||
Reference in New Issue
Block a user