diff options
-rw-r--r-- | src/compositor/wayland_wrapper/qwlkeyboard.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp index 67ad3b727..881f13bc3 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp @@ -303,8 +303,10 @@ static int createAnonymousFile(size_t size) if (fd < 0) return -1; - if (ftruncate(fd, size) < 0) + if (ftruncate(fd, size) < 0) { + close(fd); return -1; + } return fd; } |