From 4f2d56a55fd714bbd0c69eb0d0cd5ee5ccb05d1c Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sat, 26 Sep 2015 12:39:27 +0200 Subject: [PATCH] Fix another small memory leak. --- src/autotype/x11/AutoTypeX11.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/autotype/x11/AutoTypeX11.cpp b/src/autotype/x11/AutoTypeX11.cpp index 6a2b2ab6d..7f26aa08f 100644 --- a/src/autotype/x11/AutoTypeX11.cpp +++ b/src/autotype/x11/AutoTypeX11.cpp @@ -69,8 +69,14 @@ bool AutoTypePlatformX11::isAvailable() return false; } - if (!m_xkb && !getKeyboard()) { - return false; + if (!m_xkb) { + XkbDescPtr kbd = getKeyboard(); + + if (!kbd) { + return false; + } + + XkbFreeKeyboard(kbd, XkbAllComponentsMask, True); } return true;