From: Gonglei <arei.gonglei@huawei.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
"josh.durgin@inktank.com" <josh.durgin@inktank.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"stefanha@redhat.com" <stefanha@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] block/rbd: fix memory leak
Date: Thu, 11 Dec 2014 14:53:48 +0800 [thread overview]
Message-ID: <54893F7C.20801@huawei.com> (raw)
In-Reply-To: <1417674851-6248-1-git-send-email-arei.gonglei@huawei.com>
On 2014/12/4 14:34, Gonglei (Arei) wrote:
> From: Gonglei <arei.gonglei@huawei.com>
>
> Variable local_err going out of scope
> leaks the storage it points to.
>
> Cc: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
> block/rbd.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
Ping...
> diff --git a/block/rbd.c b/block/rbd.c
> index 5b5a64a..f3ab2dd 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
> @@ -459,7 +459,7 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
> clientname = qemu_rbd_parse_clientname(conf, clientname_buf);
> r = rados_create(&s->cluster, clientname);
> if (r < 0) {
> - error_setg(&local_err, "error initializing");
> + error_setg(errp, "error initializing");
> goto failed_opts;
> }
>
> @@ -495,19 +495,19 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
>
> r = rados_connect(s->cluster);
> if (r < 0) {
> - error_setg(&local_err, "error connecting");
> + error_setg(errp, "error connecting");
> goto failed_shutdown;
> }
>
> r = rados_ioctx_create(s->cluster, pool, &s->io_ctx);
> if (r < 0) {
> - error_setg(&local_err, "error opening pool %s", pool);
> + error_setg(errp, "error opening pool %s", pool);
> goto failed_shutdown;
> }
>
> r = rbd_open(s->io_ctx, s->name, &s->image, s->snap);
> if (r < 0) {
> - error_setg(&local_err, "error reading header from %s", s->name);
> + error_setg(errp, "error reading header from %s", s->name);
> goto failed_open;
> }
>
next prev parent reply other threads:[~2014-12-11 6:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-04 6:34 [Qemu-devel] [PATCH] block/rbd: fix memory leak arei.gonglei
2014-12-04 6:51 ` Amos Kong
2014-12-04 7:03 ` Gonglei
2014-12-11 6:53 ` Gonglei [this message]
2014-12-12 13:18 ` Stefan Hajnoczi
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=54893F7C.20801@huawei.com \
--to=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=josh.durgin@inktank.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.