From 529ad4eaf450e558998e7417db5db6602e7fb497 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Tue, 28 Jan 2025 10:15:08 +0100 Subject: [PATCH] ikeyboard: free xkbSymState in clearManuallyAllocd asan reported a leak on xkbSymState on destruction, because it wasnt beeing unrefed, was only being unrefed on calls to updateXKBTranslationState. --- src/devices/IKeyboard.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/devices/IKeyboard.cpp b/src/devices/IKeyboard.cpp index d1119772..4623fe84 100644 --- a/src/devices/IKeyboard.cpp +++ b/src/devices/IKeyboard.cpp @@ -44,6 +44,10 @@ void IKeyboard::clearManuallyAllocd() { if (xkbKeymapFD >= 0) close(xkbKeymapFD); + if (xkbSymState) + xkb_state_unref(xkbSymState); + + xkbSymState = nullptr; xkbKeymap = nullptr; xkbState = nullptr; xkbStaticState = nullptr;