Commit c1e7151e authored by Ganjing0224's avatar Ganjing0224 Committed by Ganjing0224
Browse files

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: Ganjing0224's avatarganjing <ganjing@uniontech.com>
parent 06d51cc4
Pipeline #190093 passed with stages
in 2 minutes and 9 seconds
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment