summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-05-30 15:48:22 +0200
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-05-30 16:16:36 +0200
commit0909a0bbfbf6de90a79e5c076b0330e99a9a9a93 (patch)
tree11b8969ec0639676e04effea5b5389a9be503c2b /src/plugins/platforms
parentdc01995397e8dda7d08e15f0b93131678188bbef (diff)
Made QXcbConnection::atomName() more fail safe.
Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 8e5391a0d1..89b50722cc 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -730,9 +730,12 @@ QByteArray QXcbConnection::atomName(xcb_atom_t atom)
{
xcb_get_atom_name_cookie_t cookie = xcb_get_atom_name_unchecked(xcb_connection(), atom);
xcb_get_atom_name_reply_t *reply = xcb_get_atom_name_reply(xcb_connection(), cookie, 0);
- QByteArray result(xcb_get_atom_name_name(reply), xcb_get_atom_name_name_length(reply));
- free(reply);
- return result;
+ if (reply) {
+ QByteArray result(xcb_get_atom_name_name(reply), xcb_get_atom_name_name_length(reply));
+ free(reply);
+ return result;
+ }
+ return QByteArray();
}
void QXcbConnection::sync()