[libvirt] [PATCH 3/6] rpc: Plug memory leak on virNetClientSendInternal() error path

Wen Congyang wency at cn.fujitsu.com
Wed Nov 30 06:26:14 UTC 2011


At 11/30/2011 01:57 PM, ajia at redhat.com Write:
> From: Alex Jia <ajia at redhat.com>
> 
> Detected by Coverity. Leak introduced in commit 673adba.
> 
> Signed-off-by: Alex Jia <ajia at redhat.com>
> ---
>  src/rpc/virnetclient.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
> index a738129..9ed03a5 100644
> --- a/src/rpc/virnetclient.c
> +++ b/src/rpc/virnetclient.c
> @@ -1740,6 +1740,7 @@ cleanup:
>  
>  unlock:
>      virNetClientUnlock(client);
> +    VIR_FREE(call);

According to the comment:
/* If partially sent, then the call is still on the dispatch queue */

So I think we should not free call if it is still on the queue.

Thanks
Wen Congyang

>      return ret;
>  }
>  




More information about the libvir-list mailing list