From: Peter Hutterer Date: Sat, 31 Aug 2013 02:59:27 +0000 (+1000) Subject: uinput: don't try to set the syspath twice X-Git-Tag: libevdev-0.4~24^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37d37cdaea9c010c5f7f0ab878617c8239d14d15;p=platform%2Fupstream%2Flibevdev.git uinput: don't try to set the syspath twice If we have it, stop searching for it. Otherwise a second device with the same name would overwrite the first, causing a leak. Signed-off-by: Peter Hutterer Reviewed-by: Benjamin Tissoires --- diff --git a/libevdev/libevdev-uinput.c b/libevdev/libevdev-uinput.c index de2833e..88ec313 100644 --- a/libevdev/libevdev-uinput.c +++ b/libevdev/libevdev-uinput.c @@ -230,6 +230,7 @@ fetch_syspath_and_devnode(struct libevdev_uinput *uinput_dev) strcat(buf, namelist[i]->d_name); uinput_dev->syspath = strdup(buf); uinput_dev->devnode = fetch_device_node(buf); + break; } }