aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel De Graaf <code@danieldg.net>2020-08-09 13:31:53 -0400
committerSimon Ser <contact@emersion.fr>2020-08-09 21:13:06 +0200
commitc236f60bb6206020396e608d6032c116fe028106 (patch)
tree201891fbf668c8201a5e236a5861c668b769ff53
parent7e990a29918968a6f418f3055fefa1d633b3016f (diff)
wlr_virtual_keyboard: fix fd leak
-rw-r--r--types/wlr_virtual_keyboard_v1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/types/wlr_virtual_keyboard_v1.c b/types/wlr_virtual_keyboard_v1.c
index 7ae030ee..25c94545 100644
--- a/types/wlr_virtual_keyboard_v1.c
+++ b/types/wlr_virtual_keyboard_v1.c
@@ -1,6 +1,7 @@
#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
+#include <unistd.h>
#include <sys/mman.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_virtual_keyboard_v1.h>
@@ -72,12 +73,14 @@ static void virtual_keyboard_keymap(struct wl_client *client,
keyboard->has_keymap = true;
xkb_keymap_unref(keymap);
xkb_context_unref(context);
+ close(fd);
return;
keymap_fail:
fd_fail:
xkb_context_unref(context);
context_fail:
wl_client_post_no_memory(client);
+ close(fd);
}
static void virtual_keyboard_key(struct wl_client *client,