qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Markus Armbruster <armbru@redhat.com>, pannengyuan@huawei.com
Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com,
	qemu-devel@nongnu.org, marcandre.lureau@redhat.com,
	zhang.zhanghailiang@huawei.com
Subject: Re: [PATCH] util/module: fix a memory leak
Date: Fri, 20 Dec 2019 08:55:53 +0100	[thread overview]
Message-ID: <c286a30f-38f1-e90b-e07e-4c9f7a8723d8@vivier.eu> (raw)
In-Reply-To: <87lfr7jvlh.fsf@dusky.pond.sub.org>

Le 20/12/2019 à 08:37, Markus Armbruster a écrit :
> Cc: qemu-trivial
> 
> <pannengyuan@huawei.com> writes:
> 
>> From: Pan Nengyuan <pannengyuan@huawei.com>
>>
>> spotted by ASAN
>>
>> Fixes: 81d8ccb1bea4fb9eaaf4c8e30bd4021180a9a39f
>> Reported-by: Euler Robot <euler.robot@huawei.com>
>> Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
>> ---
>>  util/module.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/util/module.c b/util/module.c
>> index e9fe3e5..8c5315a 100644
>> --- a/util/module.c
>> +++ b/util/module.c
>> @@ -214,6 +214,7 @@ bool module_load_one(const char *prefix, const char *lib_name)
>>  
>>      if (!success) {
>>          g_hash_table_remove(loaded_modules, module_name);
>> +        g_free(module_name);
>>      }
>>  
>>      for (i = 0; i < n_dirs; i++) {
> 
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> 
> Reviewing this made me wonder: @loaded_modules is global state, but
> there appears to be no synchronization.  What's the safety argument?
> 
> 

Applied to my trivial-patches branch.

Thanks,
Laurent


      reply	other threads:[~2019-12-20  7:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20  1:34 [PATCH] util/module: fix a memory leak pannengyuan
2019-12-20  7:37 ` Markus Armbruster
2019-12-20  7:55   ` Laurent Vivier [this message]

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=c286a30f-38f1-e90b-e07e-4c9f7a8723d8@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=armbru@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pannengyuan@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --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).