mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-01-03 17:30:20 +01:00
shell: don't crash on create_common_surface() failure
Noticed while reading code, that create_common_surface() may return NULL, and callers of its direct callers check for NULL, but the intermediate function in between would crash. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
ef2b592ad4
commit
e972b27f34
1 changed files with 6 additions and 0 deletions
|
|
@ -3879,6 +3879,9 @@ create_xdg_surface(struct shell_client *owner, void *shell,
|
|||
struct shell_surface *shsurf;
|
||||
|
||||
shsurf = create_common_surface(owner, shell, surface, client);
|
||||
if (!shsurf)
|
||||
return NULL;
|
||||
|
||||
shsurf->type = SHELL_SURFACE_TOPLEVEL;
|
||||
|
||||
return shsurf;
|
||||
|
|
@ -3963,6 +3966,9 @@ create_xdg_popup(struct shell_client *owner, void *shell,
|
|||
struct shell_surface *shsurf;
|
||||
|
||||
shsurf = create_common_surface(owner, shell, surface, client);
|
||||
if (!shsurf)
|
||||
return NULL;
|
||||
|
||||
shsurf->type = SHELL_SURFACE_POPUP;
|
||||
shsurf->popup.shseat = seat;
|
||||
shsurf->popup.serial = serial;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue