From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: Peng Hao <peng.hao2@zte.com.cn>,
qemu-devel@nongnu.org, Igor Mammedov <imammedo@redhat.com>,
Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] vhost: fix a memory leak
Date: Wed, 5 Jul 2017 00:32:49 +0300 [thread overview]
Message-ID: <20170705002803-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAJ+F1C+sWiCpSSqPdkiU0iBmdjofuv6m1FAgwPBJJUu9BJcUEA@mail.gmail.com>
On Tue, Jul 04, 2017 at 02:21:08PM +0000, Marc-André Lureau wrote:
> Hi
>
> On Tue, Jul 4, 2017 at 4:16 PM Peng Hao <peng.hao2@zte.com.cn> wrote:
>
> vhost exists a call for g_file_get_contents, but not call g_free.
>
> Signed-off-by: Peng Hao<peng.hao2@zte.com.cn>
>
>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>
>
> ---
> hw/virtio/vhost-backend.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
> index 4e31de1..2c481d6 100644
> --- a/hw/virtio/vhost-backend.c
> +++ b/hw/virtio/vhost-backend.c
> @@ -52,11 +52,13 @@ static int vhost_kernel_memslots_limit(struct vhost_dev
> *dev)
> &s, NULL, NULL)) {
> uint64_t val = g_ascii_strtoull(s, NULL, 10);
> if (!((val == G_MAXUINT64 || !val) && errno)) {
> + g_free(s);
> return val;
> }
> error_report("ignoring invalid max_mem_regions value in vhost
> module:"
> " %s", s);
> }
> + g_free(s);
> return limit;
> }
>
> --
> 1.8.3.1
>
Thanks for the review.
I'd like to include your tag in commit log.
For that, could you please repost your ack in text format using
some other mail client?
My scripts don't handle the way your mail client scrambles text.
>
>
> --
> Marc-André Lureau
next prev parent reply other threads:[~2017-07-04 21:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 22:33 [Qemu-devel] [PATCH] vhost: fix a memory leak Peng Hao
2017-07-04 14:21 ` Marc-André Lureau
2017-07-04 21:32 ` Michael S. Tsirkin [this message]
2017-07-04 21:59 ` Marc-André Lureau
2017-07-04 22:10 ` Michael S. Tsirkin
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=20170705002803-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=eblake@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=peng.hao2@zte.com.cn \
--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 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.