[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[libvirt] [PATCH 2/3] admin: Clean up error path in adminServerListClients
- From: John Ferlan <jferlan redhat com>
- To: libvir-list redhat com
- Subject: [libvirt] [PATCH 2/3] admin: Clean up error path in adminServerListClients
- Date: Fri, 6 May 2016 15:35:00 -0400
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>
---
daemon/admin_server.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/daemon/admin_server.c b/daemon/admin_server.c
index 2fc4675..41f6e82 100644
--- a/daemon/admin_server.c
+++ b/daemon/admin_server.c
@@ -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;
}
--
2.5.5
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]