mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
admin: Clean up error path in adminServerListClients
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>
This commit is contained in:
parent
4fac5a9fd3
commit
70e9114e7c
@ -191,14 +191,13 @@ adminServerListClients(virNetServerPtr srv,
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user