xwayland: prevent potential null pointer dereference

Signed-off-by: YaoBing Xiao <xiaoyaobing@uniontech.com>
(cherry picked from commit e12d9863fd)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1766>
This commit is contained in:
YaoBing Xiao 2024-10-11 09:35:18 +08:00 committed by Olivier Fourdan
parent 3bfef8d7c0
commit ca0799e7f2

View file

@ -358,11 +358,12 @@ setup_ei(ClientPtr client)
}
xwl_ei_client = calloc(1, sizeof *xwl_ei_client);
xwl_ei_client->cmdline = xstrdup(cmdname);
if (!xwl_ei_client) {
error_ei("OOM, cannot setup EI\n");
goto out;
}
xwl_ei_client->cmdline = xstrdup(cmdname);
xorg_list_init(&xwl_ei_client->link);
ei = ei_new(NULL);