Coverity points out that qemuMonitorGetAllBlockStatsInfo could return a
-1 and thus not fill in 'stats' (leaving it NULL). Then the call to
qemuMonitorBlockStatsUpdateCapacity will dereference it.
qemuDomainObjEnterMonitor(driver, dom);
rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats,
visitBacking);
- ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats,
- visitBacking));
+ if (rc >= 0)
+ ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats,
+ visitBacking));
if (qemuDomainObjExitMonitor(driver, dom) < 0)
goto cleanup;