From 70e9114e7c376151fdc209c13a42c9b2fd4f4f43 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Thu, 5 May 2016 18:32:25 -0400 Subject: [PATCH] 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 --- 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 2fc467539c..41f6e82736 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; } -- GitLab