Code Review
/
src
/
agl-compositor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
6371b14
)
agl-compositor:Add NULL check after zalloc in screenshooter.c
00/27000/2
author
AndyZhou
<zhoumy@cn.fujitsu.com>
Mon, 13 Dec 2021 03:41:25 +0000
(11:41 +0800)
committer
Zhou Mingying
<zhoumy@cn.fujitsu.com>
Tue, 21 Dec 2021 05:46:23 +0000
(
05:46
+0000)
There's no NULL check in zalloc.
xdg_output is alloced by zalloc.
Add a NULL check after zalloc and before use xdg_output.
Bug-AGL: SPEC-4178
Signed-off-by: ZhouMingying <zhoumy@cn.fujitsu.com>
Change-Id: Idc2e3fd6be823c063a84868ba37b26ffe90db6fc
clients/screenshooter.c
patch
|
blob
|
history
diff --git
a/clients/screenshooter.c
b/clients/screenshooter.c
index
64dc76a
..
8c2b553
100644
(file)
--- a/
clients/screenshooter.c
+++ b/
clients/screenshooter.c
@@
-201,6
+201,8
@@
add_xdg_output_v1_info(struct screenshooter_data *shooter_data,
struct screenshooter_output *output)
{
struct xdg_output_v1_info *xdg_output = zalloc(sizeof(*xdg_output));
+ if (!xdg_output)
+ return;
wl_list_insert(&shooter_data->xdg_output_list, &xdg_output->link);