qemu: Resolve Coverity REVERSE_INULL

Coverity complains that checking for !domlist after setting doms = domlist
and making a deref of doms just above

It seems the call in question was intended to me made in the case that
'doms' was passed in and not when the virDomainObjListExport() call
allocated domlist and already called virConnectGetAllDomainStatsCheckACL().

Thus rather than check for !domlist - check that "doms != domlist" in
order to avoid the Coverity message.

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2014-09-04 10:12:13 -04:00
parent abddeb8434
commit 9f845b1115

View File

@ -17402,7 +17402,7 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
if (!(dom = qemuDomObjFromDomain(doms[i])))
continue;
if (!domlist &&
if (doms != domlist &&
!virConnectGetAllDomainStatsCheckACL(conn, dom->def))
continue;