mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-31 07:11:09 -04: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);
|
char *map_str = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||||
if (map_str == MAP_FAILED) {
|
if (map_str == MAP_FAILED) {
|
||||||
LOG_ERRNO("failed to mmap keyboard keymap");
|
LOG_ERRNO("failed to mmap keyboard keymap");
|
||||||
|
close(fd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue