mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
[PR #2194] present: prevent memory leaks in present_create_notifies()
PR: https://github.com/X11Libre/xserver/pull/2194
This commit is contained in:
committed by
Enrico Weigelt, metux IT consult
parent
e6509060df
commit
9d58e4a665
@@ -78,6 +78,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;
|
||||
|
||||
Reference in New Issue
Block a user