diff --git a/tools/libevdev-tweak-device.c b/tools/libevdev-tweak-device.c index f2031c2..1855f0e 100644 --- a/tools/libevdev-tweak-device.c +++ b/tools/libevdev-tweak-device.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -218,7 +219,7 @@ int main(int argc, char **argv) { struct libevdev *dev = NULL; - int fd; + int fd = -1; int rc = 1; rc = parse_options(argc, argv); @@ -249,6 +250,7 @@ main(int argc, char **argv) out: libevdev_free(dev); + close(fd); return rc; }