qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] qemu-keymap: Silence memory leak warning from Clang's saniti


From: Peter Maydell
Subject: Re: [PATCH] qemu-keymap: Silence memory leak warning from Clang's sanitizer
Date: Tue, 21 Feb 2023 12:40:46 +0000

On Tue, 21 Feb 2023 at 12:26, Thomas Huth <thuth@redhat.com> wrote:
>
> When compiling QEMU with "--enable-sanitizers --enable-xkbcommon --cc=clang"
> there is a memory leak warning when running qemu-keymap:
>
>  $ ./qemu-keymap -f pc-bios/keymaps/de -l de
>
>  =================================================================
>  ==610321==ERROR: LeakSanitizer: detected memory leaks
>
>  Direct leak of 136 byte(s) in 1 object(s) allocated from:
>      #0 0x5642830d0820 in __interceptor_calloc.part.11 asan_malloc_linux.cpp.o
>      #1 0x7f31873b8d2b in xkb_state_new (/lib64/libxkbcommon.so.0+0x1dd2b) 
> (BuildId: dd32581e2248833243f3f646324ae9b98469f025)
>
>  SUMMARY: AddressSanitizer: 136 byte(s) leaked in 1 allocation(s).
>
> It can be silenced by properly releasing the "state" again
> after it has been used.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>

The leak is a "trivial" one in that we allocate only one
object and we're going to immediately exit anyway.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]