mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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:
parent
a257668ede
commit
30b6be3f8c
@ -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 *
|
||||
|
Loading…
Reference in New Issue
Block a user