mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-29 23:00:08 +01:00
test: fix leaking libevdev fd
This was the reason for the valgrind test case failures whenever we accumulated too many tests (see9c2afae1and2a110104). The cause was simply that we ran out of fds which caused libevdev to fail the scandir() searching for the event node. That resulted in a NULL devnode and an abort in litest. Close the fd before freeing the evdev device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commita84bf167a3)
This commit is contained in:
parent
92933e79f8
commit
2e02d94e2b
1 changed files with 1 additions and 0 deletions
|
|
@ -1240,6 +1240,7 @@ litest_delete_device(struct litest_device *d)
|
|||
libinput_path_remove_device(d->libinput_device);
|
||||
if (d->owns_context)
|
||||
libinput_unref(d->libinput);
|
||||
close(libevdev_get_fd(d->evdev));
|
||||
libevdev_free(d->evdev);
|
||||
libevdev_uinput_destroy(d->uinput);
|
||||
free(d->private);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue