From: Stefan Weil <sw@weilnetz.de>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vdi: Fix memory leak
Date: Tue, 22 Nov 2011 19:37:28 +0100 [thread overview]
Message-ID: <4ECBEBE8.1000709@weilnetz.de> (raw)
In-Reply-To: <1321978604-4858-1-git-send-email-kwolf@redhat.com>
Am 22.11.2011 17:16, schrieb Kevin Wolf:
> The block map is allocated in vdi_open, but was never freed.
>
> Signed-off-by: Kevin Wolf<kwolf@redhat.com>
> ---
> Applies on top if the migration blocker series.
>
> block/vdi.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/block/vdi.c b/block/vdi.c
> index 7dda522..02da6b4 100644
> --- a/block/vdi.c
> +++ b/block/vdi.c
> @@ -949,6 +949,9 @@ static int vdi_create(const char *filename, QEMUOptionParameter *options)
> static void vdi_close(BlockDriverState *bs)
> {
> BDRVVdiState *s = bs->opaque;
> +
> + g_free(s->bmap);
> +
> migrate_del_blocker(s->migration_blocker);
> error_free(s->migration_blocker);
> }
If vdi_close is called after a jump to label fail_free_bmap,
g_free(s->bmap) will be called twice.
Setting s->bmap = NULL after g_free in fail_free_bmap
would be safer.
Otherwise your patch is fine. If you send an update, you
can add
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Regards,
Stefan Weil
next prev parent reply other threads:[~2011-11-22 18:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-22 16:16 [Qemu-devel] [PATCH] vdi: Fix memory leak Kevin Wolf
2011-11-22 18:37 ` Stefan Weil [this message]
2011-11-23 8:26 ` 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=4ECBEBE8.1000709@weilnetz.de \
--to=sw@weilnetz.de \
--cc=kwolf@redhat.com \
--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).