[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/33] qemu-keymap: Silence memory leak warning from Clang's sanit
From: |
Thomas Huth |
Subject: |
[PULL 25/33] qemu-keymap: Silence memory leak warning from Clang's sanitizer |
Date: |
Mon, 27 Feb 2023 12:36:13 +0100 |
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.
Message-Id: <20230221122440.612281-1-thuth@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
qemu-keymap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/qemu-keymap.c b/qemu-keymap.c
index 4095b654a6..229866e004 100644
--- a/qemu-keymap.c
+++ b/qemu-keymap.c
@@ -226,6 +226,8 @@ int main(int argc, char *argv[])
state = xkb_state_new(map);
xkb_keymap_key_for_each(map, walk_map, state);
+ xkb_state_unref(state);
+ state = NULL;
/* add quirks */
fprintf(outfile,
--
2.31.1
- [PULL 24/33] configure: Add 'mkdir build' check, (continued)
- [PULL 24/33] configure: Add 'mkdir build' check, Thomas Huth, 2023/02/27
- [PULL 33/33] Deprecate the "-no-acpi" command line switch, Thomas Huth, 2023/02/27
- [PULL 32/33] gitlab-ci.d/base: Mark jobs as interruptible by default, Thomas Huth, 2023/02/27
- [PULL 21/33] target/s390x: Use tcg_constant_* in translate_vx.c.inc, Thomas Huth, 2023/02/27
- [PULL 17/33] s390x/pv: Add support for asynchronous teardown for reboot, Thomas Huth, 2023/02/27
- [PULL 23/33] tests/tcg/s390x: Add sam.S, Thomas Huth, 2023/02/27
- [PULL 28/33] gitlab-ci.d/buildtest: Remove aarch64-softmmu from the build-system-ubuntu job, Thomas Huth, 2023/02/27
- [PULL 31/33] gitlab-ci.d: Build with --enable-fdt=system by default, Thomas Huth, 2023/02/27
- [PULL 27/33] Updated the FSF address to <https://www.gnu.org/licenses/>, Thomas Huth, 2023/02/27
- [PULL 18/33] target/s390x: Use tcg_constant_* in local contexts, Thomas Huth, 2023/02/27
- [PULL 25/33] qemu-keymap: Silence memory leak warning from Clang's sanitizer,
Thomas Huth <=
- [PULL 26/33] meson: fix dependency on qemu-keymap, Thomas Huth, 2023/02/27
- [PULL 30/33] gitlab-ci.d/buildtest-template: Simplify the configure step, Thomas Huth, 2023/02/27
- Re: [PULL 00/33] s390x and testing related patches, Peter Maydell, 2023/02/27