From 8d2fa15e9d7c07f9230f20deffd6ca4ba1078853 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Tue, 21 Jun 2022 17:34:25 +0300 Subject: [PATCH] xdg-toplevel: post no memory on strdup() fail --- types/xdg_shell/wlr_xdg_toplevel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/xdg_shell/wlr_xdg_toplevel.c b/types/xdg_shell/wlr_xdg_toplevel.c index f929508f..dee2571f 100644 --- a/types/xdg_shell/wlr_xdg_toplevel.c +++ b/types/xdg_shell/wlr_xdg_toplevel.c @@ -157,6 +157,7 @@ static void xdg_toplevel_handle_set_title(struct wl_client *client, tmp = strdup(title); if (tmp == NULL) { + wl_resource_post_no_memory(resource); return; } @@ -173,6 +174,7 @@ static void xdg_toplevel_handle_set_app_id(struct wl_client *client, tmp = strdup(app_id); if (tmp == NULL) { + wl_resource_post_no_memory(resource); return; }