mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 03:21:19 +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);
|
virCheckFlags(0, -1);
|
||||||
|
|
||||||
if ((ret = virNetServerGetClients(srv, &clts)) < 0)
|
if ((ret = virNetServerGetClients(srv, &clts)) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (clients) {
|
if (clients) {
|
||||||
*clients = clts;
|
*clients = clts;
|
||||||
clts = NULL;
|
clts = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
|
||||||
virObjectListFreeCount(clts, ret);
|
virObjectListFreeCount(clts, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user