mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
input: keyboard: keymap: close(fd) on early-return when failing to mmap
This commit is contained in:
parent
0ed02e9676
commit
21674ab382
1 changed files with 1 additions and 0 deletions
1
input.c
1
input.c
|
|
@ -212,6 +212,7 @@ keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
|
|||
char *map_str = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
if (map_str == MAP_FAILED) {
|
||||
LOG_ERRNO("failed to mmap keyboard keymap");
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue