mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-14 22:40:29 +01:00
dix: handle allocation failure in ChangeWindowDeviceCursor()
Reported in #1817: xwayland-24.1.6/redhat-linux-build/../dix/window.c:3495:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pNewNode’ xwayland-24.1.6/redhat-linux-build/../dix/window.c:3494:20: acquire_memory: this call could return NULL Fixes:95e1a8805("Xi: Adding ChangeDeviceCursor request" in xorg 1.10.0) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2078> (cherry picked from commitc9fa8a8da1)
This commit is contained in:
parent
9bc09ee3f5
commit
71bd80bb93
1 changed files with 2 additions and 0 deletions
|
|
@ -3492,6 +3492,8 @@ ChangeWindowDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCursor)
|
|||
return Success;
|
||||
|
||||
pNewNode = malloc(sizeof(DevCursNodeRec));
|
||||
if (!pNewNode)
|
||||
return BadAlloc;
|
||||
pNewNode->dev = pDev;
|
||||
pNewNode->next = pWin->optional->deviceCursors;
|
||||
pWin->optional->deviceCursors = pNewNode;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue