mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-09 15:28:08 +02:00
Xi: add NULL checks to handle malloc failures
Co-Authored-by: Claude Code <noreply@anthropic.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2184>
This commit is contained in:
parent
532987415e
commit
3c5f5f4cf1
2 changed files with 5 additions and 0 deletions
|
|
@ -1057,6 +1057,9 @@ TouchSendOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, int reason,
|
|||
int nev, i;
|
||||
InternalEvent *tel = InitEventList(GetMaximumEventsNum());
|
||||
|
||||
if (!tel)
|
||||
return;
|
||||
|
||||
nev = GetTouchOwnershipEvents(tel, dev, ti, reason, resource, 0);
|
||||
for (i = 0; i < nev; i++)
|
||||
mieqProcessDeviceEvent(dev, tel + i, NULL);
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
|
|||
sizeof(XEventClass);
|
||||
rep.length = bytes_to_int32(total_length);
|
||||
buf = (XEventClass *) malloc(total_length);
|
||||
if (!buf)
|
||||
return BadAlloc;
|
||||
|
||||
tclient = buf;
|
||||
aclient = buf + rep.this_client_count;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue