summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-10-17 16:55:27 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-10-30 09:42:28 +1000
commit520789925cc5885670ea23e56abf6374893b3797 (patch)
tree2be6472dcd04af027052cb89f79e8a7423658dd5
parentb87487f808d41fc168557a84089ed10354babcf6 (diff)
test: unref the litest device *after* removing it from the path interface
Our own reference may be the last one that's still alive if the context is currently suspended (litest_suspend()). If we unref before removing it from the path interface, we access already freed memory. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 40144321b234f8cee0059cf5bada8c0845065851)
-rw-r--r--test/litest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/litest.c b/test/litest.c
index 119d3753..84f7b089 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -1476,8 +1476,9 @@ litest_delete_device(struct litest_device *d)
litest_assert_int_eq(d->skip_ev_syn, 0);
- libinput_device_unref(d->libinput_device);
libinput_path_remove_device(d->libinput_device);
+ libinput_device_unref(d->libinput_device);
+
if (d->owns_context)
libinput_unref(d->libinput);
close(libevdev_get_fd(d->evdev));