]> xenbits.xensource.com Git - libvirt.git/commitdiff
admin: Clean up error path in adminServerListClients
authorJohn Ferlan <jferlan@redhat.com>
Thu, 5 May 2016 22:32:25 +0000 (18:32 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 9 May 2016 23:33:56 +0000 (19:33 -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

index 2fc467539cd8260f59a10f0de7bf308c18aa30bf..41f6e827360498a13e65f1c5bf054bad92567126 100644 (file)
@@ -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;
 }