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>
This commit is contained in:
parent
2588a5b249
commit
7e40ea4499
@ -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);
|
xcb_get_atom_name_reply_t *reply = xcb_get_atom_name_reply(xcb_connection(), cookie, &error);
|
||||||
if (error) {
|
if (error) {
|
||||||
qWarning() << "QXcbConnection::atomName: bad Atom" << atom;
|
qWarning() << "QXcbConnection::atomName: bad Atom" << atom;
|
||||||
|
free(error);
|
||||||
}
|
}
|
||||||
if (reply) {
|
if (reply) {
|
||||||
QByteArray result(xcb_get_atom_name_name(reply), xcb_get_atom_name_name_length(reply));
|
QByteArray result(xcb_get_atom_name_name(reply), xcb_get_atom_name_name_length(reply));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user