mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-04-18 00:20:41 +02:00
Merge branch 'present-1817' into 'main'
present: prevent memory leaks in present_create_notifies() See merge request xorg/xserver!2164
This commit is contained in:
commit
54c785cdaa
1 changed files with 7 additions and 0 deletions
|
|
@ -76,6 +76,13 @@ present_create_notifies(ClientPtr client, int num_notifies, xPresentNotify *x_no
|
|||
int added = 0;
|
||||
int status;
|
||||
|
||||
if (num_notifies <= 0) {
|
||||
if (num_notifies == 0)
|
||||
return Success;
|
||||
else
|
||||
return BadLength;
|
||||
}
|
||||
|
||||
notifies = calloc (num_notifies, sizeof (present_notify_rec));
|
||||
if (!notifies)
|
||||
return BadAlloc;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue