qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: pannengyuan@huawei.com, thuth@redhat.com, pbonzini@redhat.com
Cc: zhang.zhanghailiang@huawei.com, qemu-devel@nongnu.org
Subject: Re: [PATCH] vhost-user-test: fix a memory leak
Date: Wed, 11 Dec 2019 08:48:14 +0100	[thread overview]
Message-ID: <42a2d54e-622a-2023-3d58-70dffa71027d@redhat.com> (raw)
In-Reply-To: <1576025722-41720-1-git-send-email-pannengyuan@huawei.com>

On 11/12/2019 01:55, pannengyuan@huawei.com wrote:
> From: Pan Nengyuan <pannengyuan@huawei.com>
> 
> Spotted by ASAN.
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
> ---
>  tests/vhost-user-test.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
> index 91ea373..54be931 100644
> --- a/tests/vhost-user-test.c
> +++ b/tests/vhost-user-test.c
> @@ -717,6 +717,8 @@ static void test_migrate(void *obj, void *arg, QGuestAllocator *alloc)
>      guint64 size;
>  
>      if (!wait_for_fds(s)) {
> +        g_free(uri);
> +        test_server_free(dest);
>          return;
>      }
>  

Don't we need also a g_string_free(dest_cmdline)?

I think it is also missing at the end of the function.

Thanks,
Laurent



  reply	other threads:[~2019-12-11  7:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  0:55 [PATCH] vhost-user-test: fix a memory leak pannengyuan
2019-12-11  7:48 ` Laurent Vivier [this message]
2019-12-12  1:11   ` Pan Nengyuan
2019-12-11  7:57 ` Thomas Huth
2019-12-11  8:18   ` Marc-André Lureau
2019-12-12  1:48     ` Pan Nengyuan
2019-12-12  1:41   ` Pan Nengyuan

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=42a2d54e-622a-2023-3d58-70dffa71027d@redhat.com \
    --to=lvivier@redhat.com \
    --cc=pannengyuan@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=zhang.zhanghailiang@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).