diff --git a/apps/shortcuts.c b/apps/shortcuts.c index 9955b7f19d..7b224dde2f 100644 --- a/apps/shortcuts.c +++ b/apps/shortcuts.c @@ -372,8 +372,11 @@ void shortcuts_init(void) if (fd < 0) return; first_handle = core_alloc_ex("shortcuts_head", sizeof(struct shortcut_handle), &shortcut_ops); - if (first_handle <= 0) + if (first_handle <= 0) { + close(fd); return; + } + h = core_get_data(first_handle); h->next_handle = 0;