summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2012-01-07 17:28:10 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-08 21:55:10 +0100
commit7e40ea4499ff9a6a96bf71019428dbb08876a2cd (patch)
treeec9c61a4271e65deebf3ae112928bb0d2e474c08 /src
parent2588a5b24965d9afa0d6e368a9f42491d1cfb5f7 (diff)
xcb: Fix a memleak when atomName() fails
The only reason for GetAtomName to fail is when an invalid atom is specified, so the xcb_generic_error_t struct doesn't contain any useful information for us. Still, we have to free it. Change-Id: I3da98018b7bfe08a9d7dcd566ed010f5d7b0df73 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index de091b0308..ed995fd8cd 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -962,6 +962,7 @@ QByteArray QXcbConnection::atomName(xcb_atom_t atom)
xcb_get_atom_name_reply_t *reply = xcb_get_atom_name_reply(xcb_connection(), cookie, &error);
if (error) {
qWarning() << "QXcbConnection::atomName: bad Atom" << atom;
+ free(error);
}
if (reply) {
QByteArray result(xcb_get_atom_name_name(reply), xcb_get_atom_name_name_length(reply));