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
struct screenshooter_output *output)
{
struct xdg_output_v1_info *xdg_output = zalloc(sizeof(*xdg_output));
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);
wl_list_insert(&shooter_data->xdg_output_list, &xdg_output->link);