desktop-shell: check memory allocation in switcher_binding
after calling malloc() , be sure to determine whether the allocating for memory space is successful Signed-off-by: ganjing <ganjing@uniontech.com>
This commit is contained in:
parent
06d51cc4cb
commit
c1e7151eb6
@ -4630,6 +4630,9 @@ switcher_binding(struct weston_keyboard *keyboard, const struct timespec *time,
|
||||
struct switcher *switcher;
|
||||
|
||||
switcher = malloc(sizeof *switcher);
|
||||
if (!switcher)
|
||||
return;
|
||||
|
||||
switcher->shell = shell;
|
||||
switcher->current = NULL;
|
||||
switcher->listener.notify = switcher_handle_view_destroy;
|
||||
|
Loading…
Reference in New Issue
Block a user