test: fix memleak in the udev_device_sysname() test

If a device sends other events at startup, those events weren't freed. This
can happen on tablet devices that send proximity events immediately after
DEVICE_ADDED.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2015-07-09 16:46:00 +10:00
parent 6e8dc031ba
commit cc46e00e81

View file

@ -413,8 +413,11 @@ START_TEST(udev_device_sysname)
libinput_dispatch(li);
while ((ev = libinput_get_event(li))) {
if (libinput_event_get_type(ev) != LIBINPUT_EVENT_DEVICE_ADDED)
if (libinput_event_get_type(ev) !=
LIBINPUT_EVENT_DEVICE_ADDED) {
libinput_event_destroy(ev);
continue;
}
device = libinput_event_get_device(ev);
sysname = libinput_device_get_sysname(device);