From: Paolo Bonzini <pbonzini@redhat.com>
To: yaolujing <yaolujing@huawei.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] nbd: fix memory leak on socket_connect failed
Date: Mon, 3 Apr 2017 09:06:02 +0200 [thread overview]
Message-ID: <1c0c7176-dd02-720c-11c7-493526cec6d5@redhat.com> (raw)
In-Reply-To: <1491005709-29989-1-git-send-email-yaolujing@huawei.com>
On 01/04/2017 02:15, 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(+)
>
> 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;
> }
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2017-04-03 7:06 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 ` [Qemu-devel] [PATCH for-2.9] " Eric Blake
2017-04-03 7:06 ` Paolo Bonzini [this message]
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=1c0c7176-dd02-720c-11c7-493526cec6d5@redhat.com \
--to=pbonzini@redhat.com \
--cc=eric.fangyi@huawei.com \
--cc=kwolf@redhat.com \
--cc=mreitz@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).