qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.9] nbd: fix memory leak on so


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH for-2.9] nbd: fix memory leak on socket_connect failed
Date: Sat, 1 Apr 2017 09:37:19 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 03/31/2017 07:15 PM, yaolujing wrote:
> From: y00357587 <address@hidden>
> 
> When TCP connection fails between nbd server and client,
> the local var, sioc, memory leak.
> 
> This patch fixes the memory leak.
> 
> Signed-off-by: y00357587 <address@hidden>
> ---
>  block/nbd.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Eric Blake <address@hidden>

> 
> diff --git a/block/nbd.c b/block/nbd.c
> index 35f24be..102285e 100644
> --- a/block/nbd.c
> +++ b/block/nbd.c
> @@ -313,6 +313,7 @@ static QIOChannelSocket 
> *nbd_establish_connection(SocketAddress *saddr,
>                                      saddr,
>                                      &local_err);
>      if (local_err) {
> +        object_unref(OBJECT(sioc));
>          error_propagate(errp, local_err);
>          return NULL;
>      }
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]