projects
/
platform
/
upstream
/
weston.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06d51cc
)
desktop-shell: check memory allocation in switcher_binding
author
ganjing
<ganjing@uniontech.com>
Tue, 28 Jul 2020 07:28:45 +0000
(15:28 +0800)
committer
Ganjing0224
<ganjing@uniontech.com>
Fri, 14 Aug 2020 02:00:25 +0000
(
02:00
+0000)
after calling malloc() , be sure to determine whether the allocating for memory space is successful
Signed-off-by: ganjing <ganjing@uniontech.com>
desktop-shell/shell.c
patch
|
blob
|
history
diff --git
a/desktop-shell/shell.c
b/desktop-shell/shell.c
index ef0696ed526732206d1b8417f95a45136aac1152..40cba183a8e15401308fbf39796331c90eb497ff 100644
(file)
--- a/
desktop-shell/shell.c
+++ b/
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;