virNetServerGetClients: Remove pointless cleanup

'list' will always be NULL when reaching 'virObjectListFreeCount' thus
we can remove the call as well as the 'ret' variable which was only ever
equal to 'nclients' at the point when we returned the value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2021-08-04 11:36:31 +02:00
parent a257668ede
commit 30b6be3f8c

View File

@ -1077,7 +1077,6 @@ int
virNetServerGetClients(virNetServer *srv,
virNetServerClient ***clts)
{
int ret = -1;
size_t i;
size_t nclients = 0;
virNetServerClient **list = NULL;
@ -1090,11 +1089,10 @@ virNetServerGetClients(virNetServer *srv,
}
*clts = g_steal_pointer(&list);
ret = nclients;
virObjectListFreeCount(list, nclients);
virObjectUnlock(srv);
return ret;
return nclients;
}
virNetServerClient *