Coverity noted that in adminServerListClients if virNetServerGetClients
returns a -1 into ret, then the call virObjectListFreeCount in cleanup
will not be very happy.
Adjust the code to skip the cleanup label and just return -1 if
virNetServerGetClients fails.
Signed-off-by: John Ferlan <jferlan@redhat.com>
virCheckFlags(0, -1);
if ((ret = virNetServerGetClients(srv, &clts)) < 0)
- goto cleanup;
+ return -1;
if (clients) {
*clients = clts;
clts = NULL;
}
- cleanup:
virObjectListFreeCount(clts, ret);
return ret;
}