shortcuts: fix file handle leak on OOM condition
Change-Id: If09db7a084d83e9bdeeafb8e8f434fcb502c45c5
This commit is contained in:
parent
d0536b8b6b
commit
77ec752248
|
@ -372,8 +372,11 @@ void shortcuts_init(void)
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return;
|
return;
|
||||||
first_handle = core_alloc_ex("shortcuts_head", sizeof(struct shortcut_handle), &shortcut_ops);
|
first_handle = core_alloc_ex("shortcuts_head", sizeof(struct shortcut_handle), &shortcut_ops);
|
||||||
if (first_handle <= 0)
|
if (first_handle <= 0) {
|
||||||
|
close(fd);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
h = core_get_data(first_handle);
|
h = core_get_data(first_handle);
|
||||||
h->next_handle = 0;
|
h->next_handle = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue