From: Ashijeet Acharya <ashijeetacharya@gmail.com>
To: kwolf@redhat.com
Cc: mreitz@redhat.com, pbonzini@redhat.com, eblake@redhat.com,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
Ashijeet Acharya <ashijeetacharya@gmail.com>
Subject: [Qemu-devel] [PATCH v3] block/nbd: Fix the leaked visitor
Date: Wed, 2 Nov 2016 16:10:03 +0530 [thread overview]
Message-ID: <1478083203-9465-1-git-send-email-ashijeetacharya@gmail.com> (raw)
This patch frees the leaked visitor in nbd_refresh_filename() and uses
visit_free() to fix it. The leak was introduced by the commit 491d6c7.
Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
Changes in v3:
- Modify the Subject line
- Free the visitor immediately after visit_complete()
---
block/nbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/nbd.c b/block/nbd.c
index 8ef1438..d656eb1 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -534,6 +534,7 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
ov = qobject_output_visitor_new(&saddr_qdict);
visit_type_SocketAddress(ov, NULL, &s->saddr, &error_abort);
visit_complete(ov, &saddr_qdict);
+ visit_free(ov);
assert(qobject_type(saddr_qdict) == QTYPE_QDICT);
qdict_put_obj(opts, "server", saddr_qdict);
--
2.6.2
next reply other threads:[~2016-11-02 10:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-02 10:40 Ashijeet Acharya [this message]
2016-11-02 10:53 ` [Qemu-devel] [PATCH v3] block/nbd: Fix the leaked visitor Kevin Wolf
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=1478083203-9465-1-git-send-email-ashijeetacharya@gmail.com \
--to=ashijeetacharya@gmail.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).