[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/3] admin: Clean up error path in adminServerListClients



On 06/05/16 21:35, John Ferlan wrote:
> 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;
>  }
> 

ACK

Erik


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]