Fix three coverity complaints
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 25 Mar 2019 05:15:13 +0000 (15:15 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 25 Mar 2019 05:15:13 +0000 (15:15 +1000)
Two resource leaks, one uninitialized variable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/litest.c
tools/libinput-record.c

index 6b44d45f6bd93f9ff6d17d15a8c56883fe8e365b..438a37147e8f62e13a771453b06e66a39474e7e4 100644 (file)
@@ -1440,11 +1440,11 @@ litest_create(enum litest_device_type which,
                                break;
                        }
                }
-
-               free(abs);
-               free(events);
        }
 
+       free(abs);
+       free(events);
+
        path = libevdev_uinput_get_devnode(d->uinput);
        litest_assert(path != NULL);
        fd = open(path, O_RDWR|O_NONBLOCK);
index e1eacdd32493ebc3a3a549cb9a7f0a15c0664474..757892a5c6fca73eeb6258687f67922b9beec746 100644 (file)
@@ -1841,7 +1841,7 @@ select_device(void)
        int ndev, selected_device;
        int rc;
        char *device_path;
-       bool has_eaccess;
+       bool has_eaccess = false;
        int available_devices = 0;
 
        ndev = scandir("/dev/input", &namelist, is_event_node, versionsort);