[PR #2194] present: prevent memory leaks in present_create_notifies()

PR: https://github.com/X11Libre/xserver/pull/2194
This commit is contained in:
Alan Coopersmith
2026-03-30 12:06:04 -07:00
committed by Enrico Weigelt, metux IT consult
parent e6509060df
commit 9d58e4a665

View File

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