Xi: handle allocation failure in add_master_func()

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 <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2075>
This commit is contained in:
Alan Coopersmith 2025-10-05 17:52:39 -07:00 committed by Marge Bot
parent 19c6195e71
commit 0ee6039053

View file

@ -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();