mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 05:50:26 +01:00
tablet: fix a memory leak caused by an early return
Previously we'd return early, failing to libwacom_destroy() the device. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1064>
This commit is contained in:
parent
1c80605d56
commit
5f744c8928
1 changed files with 8 additions and 10 deletions
|
|
@ -2596,8 +2596,6 @@ tablet_lookup_libwacom(struct evdev_device *device,
|
|||
const char *devnode;
|
||||
WacomDeviceDatabase *db;
|
||||
WacomDevice *libwacom_device = NULL;
|
||||
const int *stylus_ids;
|
||||
int nstyli;
|
||||
int vid = evdev_device_get_id_vendor(device);
|
||||
|
||||
db = tablet_libinput_context(tablet)->libwacom.db;
|
||||
|
|
@ -2618,14 +2616,14 @@ tablet_lookup_libwacom(struct evdev_device *device,
|
|||
* lenovo pens so we use that as the flag of whether the tablet
|
||||
* is an AES tablet
|
||||
*/
|
||||
if (vid != VENDOR_ID_WACOM)
|
||||
return;
|
||||
|
||||
stylus_ids = libwacom_get_supported_styli(libwacom_device, &nstyli);
|
||||
for (int i = 0; i < nstyli; i++) {
|
||||
if (stylus_ids[i] == 0x11) {
|
||||
*is_aes = true;
|
||||
break;
|
||||
if (vid == VENDOR_ID_WACOM) {
|
||||
int nstyli;
|
||||
const int *stylus_ids = libwacom_get_supported_styli(libwacom_device, &nstyli);
|
||||
for (int i = 0; i < nstyli; i++) {
|
||||
if (stylus_ids[i] == 0x11) {
|
||||
*is_aes = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue