From 0ee603905387e00a2e3d83ead1de99ca61d641fb Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 5 Oct 2025 17:52:39 -0700 Subject: [PATCH] Xi: handle allocation failure in add_master_func() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported in #1817: xwayland-24.1.6/redhat-linux-build/../Xi/xibarriers.c:729:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘AllocBarrierDevice()’ Signed-off-by: Alan Coopersmith Part-of: --- Xi/xibarriers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c index b7c3393d4..bca99b3d3 100644 --- a/Xi/xibarriers.c +++ b/Xi/xibarriers.c @@ -727,6 +727,8 @@ static void add_master_func(void *res, XID id, void *devid) pbd = AllocBarrierDevice(); + if (!pbd) + return; pbd->deviceid = *deviceid; input_lock();