XCB: fix a memory leak

An early return caused a leak of a new'd allocated object.

Change-Id: I9fbc37238dd49066d24363a2e8ee8bf35b155301
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
This commit is contained in:
Giuseppe D'Angelo 2014-09-21 11:12:58 +02:00
parent 8259413e41
commit ebdd56c5bd

View File

@ -335,8 +335,10 @@ XInput2DeviceData *QXcbConnection::deviceForId(int id)
QTouchDevice::Capabilities caps = 0;
dev = new XInput2DeviceData;
dev->xiDeviceInfo = XIQueryDevice(static_cast<Display *>(m_xlib_display), id, &nrDevices);
if (nrDevices <= 0)
if (nrDevices <= 0) {
delete dev;
return 0;
}
int type = -1;
int maxTouchPoints = 1;
bool hasRelativeCoords = false;