summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-08-07 11:04:47 +1000
committerKristian Høgsberg <krh@bitplanet.net>2013-08-20 16:11:07 -0700
commit52776d0d5aaf7899ef1462f61570dc321baff4af (patch)
tree1f10bba2697e8acdbdbc187a9c1c70fdddfecf1b
parent839c0b3d4abe5c5fc4840b9b916ad1e55d58359e (diff)
downloadweston-52776d0d5aaf7899ef1462f61570dc321baff4af.tar.gz
weston-52776d0d5aaf7899ef1462f61570dc321baff4af.tar.bz2
weston-52776d0d5aaf7899ef1462f61570dc321baff4af.zip
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.
-rw-r--r--src/evdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 999ab8e6..2cb3432e 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -594,6 +594,8 @@ evdev_device_create(struct weston_seat *seat, const char *path, int device_fd)
device->devname = strdup(devname);
if (!evdev_handle_device(device)) {
+ if (device->dispatch)
+ device->dispatch->interface->destroy(dispatch);
if (device->mtdev)
mtdev_close_delete(device->mtdev);
free(device->devnode);