mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-09 02:28:05 +02:00
evdev: plug a potential memleak
For touchpads, device->dispatch is set up when exiting evdev_handle_device() and a potential source for a memleak. This can't actually happen at the moment, as evdev_handle_device() won't fail for touchpads after setting up the dispatch but prevent this from happening in the future.
This commit is contained in:
parent
3fe16ee03b
commit
b23c3273bc
1 changed files with 2 additions and 0 deletions
|
|
@ -593,6 +593,8 @@ evdev_device_create(struct weston_seat *seat, const char *path, int device_fd)
|
||||||
device->devname = strdup(devname);
|
device->devname = strdup(devname);
|
||||||
|
|
||||||
if (!evdev_handle_device(device)) {
|
if (!evdev_handle_device(device)) {
|
||||||
|
if (device->dispatch)
|
||||||
|
device->dispatch->interface->destroy(dispatch);
|
||||||
if (device->mtdev)
|
if (device->mtdev)
|
||||||
mtdev_close_delete(device->mtdev);
|
mtdev_close_delete(device->mtdev);
|
||||||
free(device->devnode);
|
free(device->devnode);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue