From: Eric Blake <eblake@redhat.com>
To: yaolujing <yaolujing@huawei.com>,
pbonzini@redhat.com, kwolf@redhat.com, mreitz@redhat.com
Cc: xieyingtai@huawei.com, qemu-block@nongnu.org, subo7@huawei.com,
zhangshuai13@huawei.com, eric.fangyi@huawei.com,
qemu-devel@nongnu.org, wangjie88@huawei.com,
sochin.jiang@huawei.com
Subject: Re: [Qemu-devel] [PATCH for-2.9] nbd: fix memory leak on socket_connect failed
Date: Sat, 1 Apr 2017 09:37:19 -0500 [thread overview]
Message-ID: <2cb95ae5-90c8-f8b8-466f-2965d12fac05@redhat.com> (raw)
In-Reply-To: <1491005709-29989-1-git-send-email-yaolujing@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 971 bytes --]
On 03/31/2017 07:15 PM, yaolujing wrote:
> From: y00357587 <yaolujing@huawei.com>
>
> 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 <yaolujing@huawei.com>
> ---
> block/nbd.c | 1 +
> 1 file changed, 1 insertion(+)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-04-01 14:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-01 0:15 [Qemu-devel] [PATCH] nbd: fix memory leak on socket_connect failed yaolujing
2017-04-01 14:37 ` Eric Blake [this message]
2017-04-03 7:06 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2cb95ae5-90c8-f8b8-466f-2965d12fac05@redhat.com \
--to=eblake@redhat.com \
--cc=eric.fangyi@huawei.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sochin.jiang@huawei.com \
--cc=subo7@huawei.com \
--cc=wangjie88@huawei.com \
--cc=xieyingtai@huawei.com \
--cc=yaolujing@huawei.com \
--cc=zhangshuai13@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).