From: jeon Date: Thu, 12 Mar 2020 10:44:25 +0000 (+0900) Subject: udev-seat: fix a memory leak X-Git-Tag: submit/tizen/20220208.100129~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c32a90f463415a1ba8b387fc93f18a80f7c723fb;p=platform%2Fupstream%2Flibinput.git udev-seat: fix a memory leak Change-Id: Ic6aff8a80c272da3510d611c0fc31f4ace73fbaf --- diff --git a/src/udev-seat.c b/src/udev-seat.c index c3599026..dc3a5e9a 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -130,6 +130,12 @@ device_added(struct udev_device *udev_device, devnode = udev_device_get_devnode(udev_device); sysname = udev_device_get_sysname(udev_device); + if (libinput_path_has_device(&input->base, devnode)) + { + log_info(&input->base, "libinput_path already created input device '%s.\n", devnode); + return 0; + } + /* Search for matching logical seat */ if (!seat_name) seat_name = udev_device_get_property_value(udev_device, "WL_SEAT"); @@ -153,11 +159,6 @@ device_added(struct udev_device *udev_device, return -1; } - if (libinput_path_has_device(&input->base, devnode)) - { - log_info(&input->base, "libinput_path already created input device '%s.\n", devnode); - return 0; - } device = evdev_device_create(&seat->base, udev_device); libinput_seat_unref(&seat->base);