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>
dev
ganjing 4 years ago committed by Ganjing0224
parent 06d51cc4cb
commit c1e7151eb6
  1. 3
      desktop-shell/shell.c

@ -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…
Cancel
Save