QEMU-Devel Archive mirror
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@daynix.com>
To: Michael Tokarev <mjt@tls.msk.ru>, Laurent Vivier <laurent@vivier.eu>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Subject: Re: [PATCH] qemu-keymap: Free xkb allocations
Date: Sun, 5 May 2024 19:29:38 +0900	[thread overview]
Message-ID: <edad61c6-2b7c-4982-9038-afcd765f6df6@daynix.com> (raw)
In-Reply-To: <b3b6ba1d-3f58-45f8-96fc-800e6ec95284@tls.msk.ru>

On 2024/05/05 19:24, Michael Tokarev wrote:
> 01.05.2024 10:55, Akihiko Odaki wrote:
>> This fixes LeakSanitizer complaints with xkbcommon 1.6.0.
>>
>> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
>> ---
>>   qemu-keymap.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/qemu-keymap.c b/qemu-keymap.c
>> index 8c80f7a4ed65..7a9f38cf9863 100644
>> --- a/qemu-keymap.c
>> +++ b/qemu-keymap.c
>> @@ -237,6 +237,9 @@ int main(int argc, char *argv[])
>>       xkb_state_unref(state);
>>       state = NULL;
>> +    xkb_keymap_unref(map);
>> +    xkb_context_unref(ctx);
>> +
> 
> I'd avoid freeing any resources in main() entirely,
> since it's much cheaper to free whole process by the
> kernel at exit time than to mess with each chunk of
> allocated memory.  Dunno how useful it is to "fix"
> these.
> 
> /mjt

This is purely to satisfy LeakSanitizier; the LeakSanitizer complaints 
result in a build failure with many noisy logs. I don't add Fixes: tags 
for this kind of leaks.

Regards,
Akihiko Odaki


      reply	other threads:[~2024-05-05 10:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-01  7:55 [PATCH] qemu-keymap: Free xkb allocations Akihiko Odaki
2024-05-05 10:24 ` Michael Tokarev
2024-05-05 10:29   ` Akihiko Odaki [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=edad61c6-2b7c-4982-9038-afcd765f6df6@daynix.com \
    --to=akihiko.odaki@daynix.com \
    --cc=laurent@vivier.eu \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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 read-only IMAP folder(s) and NNTP newsgroup(s).