In virNetServerNew, Coverity didn't realize that srv->mdsnGroupName
can only be non-NULL if mdsnGroupName was non-NULL.
In virNetServerRun, Coverity didn't realize that the array is non-NULL
if the array count is non-zero.
* src/rpc/virnetserver.c (virNetServerNew): Use alternate pointer.
(virNetServerRun): Give coverity a hint.
if (srv->mdnsGroupName) {
if (!(srv->mdns = virNetServerMDNSNew()))
goto error;
- if (!(srv->mdnsGroup = virNetServerMDNSAddGroup(srv->mdns, mdnsGroupName)))
+ if (!(srv->mdnsGroup = virNetServerMDNSAddGroup(srv->mdns,
+ srv->mdnsGroupName)))
goto error;
}
#endif
reprocess:
for (i = 0 ; i < srv->nclients ; i++) {
+ /* Coverity 5.3.0 couldn't see that srv->clients is non-NULL
+ * if srv->nclients is non-zero. */
+ sa_assert(srv->clients);
if (virNetServerClientWantClose(srv->clients[i]))
virNetServerClientClose(srv->clients[i]);
if (virNetServerClientIsClosed(srv->clients[i])) {