mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-03-22 05:40:39 +01:00
evdev: plug memory leak on libevdev_new_from_fd failure
Found by coverity. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
f5e014f8b0
commit
c6478bbeeb
1 changed files with 2 additions and 3 deletions
|
|
@ -885,10 +885,11 @@ evdev_device_create(struct libinput_seat *seat,
|
|||
return NULL;
|
||||
|
||||
libinput_device_init(&device->base, seat);
|
||||
libinput_seat_ref(seat);
|
||||
|
||||
rc = libevdev_new_from_fd(fd, &device->evdev);
|
||||
if (rc != 0)
|
||||
return NULL;
|
||||
goto err;
|
||||
|
||||
libevdev_set_clock_id(device->evdev, CLOCK_MONOTONIC);
|
||||
|
||||
|
|
@ -905,8 +906,6 @@ evdev_device_create(struct libinput_seat *seat,
|
|||
device->pending_event = EVDEV_NONE;
|
||||
device->devname = libevdev_get_name(device->evdev);
|
||||
|
||||
libinput_seat_ref(seat);
|
||||
|
||||
if (evdev_configure_device(device) == -1)
|
||||
goto err;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue