mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 04:18:05 +02:00
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
1 changed files with 3 additions and 0 deletions
|
|
@ -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…
Add table
Reference in a new issue