From 0cfd40ac0caf9dbde00de8d75750357ffc6331de Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Thu, 11 Jul 2013 10:28:44 -0400 Subject: [PATCH] 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. --- tools/virsh-domain-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 7af765e8ec..5fbd32c164 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -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) { -- 2.39.5