From d45584d1de4fdedd0e43c7b1d6d4215ca3abfb64 Mon Sep 17 00:00:00 2001 From: Wolfgang Bauer Date: Mon, 26 Jun 2017 18:02:49 +0200 Subject: [PATCH] [xembedsniproxy] Free windowAttributes in every case The structure was only freed in case the XTest method was chosen. But it should always be freed of course (as long as it isn't NULL). Use a QScopedPointer instead to free it automatically when it goes out of scope and to be more consistent with the rest of t Differential Revision: https://phabricator.kde.org/D6389 --- xembed-sni-proxy/sniproxy.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index b2f64fbc2..7fb00dbb2 100644 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -208,10 +208,9 @@ SNIProxy::SNIProxy(xcb_window_t wid, QObject* parent): //we query if the client selected button presses in the event mask //if the client does supports that we send directly, otherwise we'll use xtest auto waCookie = xcb_get_window_attributes(c, wid); - auto windowAttributes = xcb_get_window_attributes_reply(c, waCookie, nullptr); + QScopedPointer windowAttributes(xcb_get_window_attributes_reply(c, waCookie, nullptr)); if (windowAttributes && ! (windowAttributes->all_event_masks & XCB_EVENT_MASK_BUTTON_PRESS)) { m_injectMode = XTest; - free(windowAttributes); } //there's no damage event for the first paint, and sometimes it's not drawn immediately