qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pan Nengyuan <pannengyuan@huawei.com>
To: Laurent Vivier <lvivier@redhat.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: Thu, 12 Dec 2019 09:11:51 +0800	[thread overview]
Message-ID: <a29e8aeb-d15a-a3f6-a50c-25899d99983f@huawei.com> (raw)
In-Reply-To: <42a2d54e-622a-2023-3d58-70dffa71027d@redhat.com>



On 2019/12/11 15:48, Laurent Vivier wrote:
> 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.
> 
Yes, you are right. But I'm surprised that it hasn't been detected by asan.

I will continue to try it and send a new version.

> Thanks,
> Laurent
> 
> 



  reply	other threads:[~2019-12-12  1:12 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
2019-12-12  1:11   ` Pan Nengyuan [this message]
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=a29e8aeb-d15a-a3f6-a50c-25899d99983f@huawei.com \
    --to=pannengyuan@huawei.com \
    --cc=lvivier@redhat.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).