test: release a few leaking udev devices
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 26 Jul 2018 00:25:52 +0000 (10:25 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 26 Jul 2018 01:51:21 +0000 (11:51 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/litest.c
test/test-quirks.c

index 7febc3b..e4b5a49 100644 (file)
@@ -1562,6 +1562,7 @@ litest_add_device_with_overrides(struct libinput *libinput,
                                 const struct input_absinfo *abs_override,
                                 const int *events_override)
 {
+       struct udev_device *ud;
        struct litest_device *d;
        const char *path;
 
@@ -1576,8 +1577,9 @@ litest_add_device_with_overrides(struct libinput *libinput,
 
        d->libinput = libinput;
        d->libinput_device = libinput_path_add_device(d->libinput, path);
-       d->quirks = quirks_fetch_for_device(quirks_context,
-                                           libinput_device_get_udev_device(d->libinput_device));
+       ud = libinput_device_get_udev_device(d->libinput_device);
+       d->quirks = quirks_fetch_for_device(quirks_context, ud);
+       udev_device_unref(ud);
 
        litest_assert(d->libinput_device != NULL);
        libinput_device_ref(d->libinput_device);
index 6ca2614..aa685e6 100644 (file)
@@ -859,6 +859,7 @@ START_TEST(quirks_model_one)
        quirks_unref(q);
        quirks_context_unref(ctx);
        cleanup_data_dir(dd);
+       udev_device_unref(ud);
 }
 END_TEST
 
@@ -891,6 +892,7 @@ START_TEST(quirks_model_zero)
        quirks_unref(q);
        quirks_context_unref(ctx);
        cleanup_data_dir(dd);
+       udev_device_unref(ud);
 }
 END_TEST