bug found and fixed

This commit is contained in:
Denis 2023-12-08 01:04:46 +01:00
parent fbd4db8b18
commit 2f47bc1661
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03

View file

@ -123,6 +123,7 @@ int dev_evdev_open(
if (libevdev_new_from_fd(fd, &out_evdev) != 0) { if (libevdev_new_from_fd(fd, &out_evdev) != 0) {
fprintf(stderr, "Cannot initialize libevdev from this device (%s) -- Skipping.\n", path); fprintf(stderr, "Cannot initialize libevdev from this device (%s) -- Skipping.\n", path);
open_fds[open_sysfs_idx] = -1;
close(fd); close(fd);
continue; continue;
} else { } else {
@ -132,6 +133,7 @@ int dev_evdev_open(
// try to open the device // try to open the device
if (!ev_matches(out_evdev, in_filters)) { if (!ev_matches(out_evdev, in_filters)) {
libevdev_free(out_evdev); libevdev_free(out_evdev);
open_fds[open_sysfs_idx] = -1;
close(fd); close(fd);
continue; continue;
} }