diff --git a/Xi/getselev.c b/Xi/getselev.c index 73d71d5bcd..8941c21874 100644 --- a/Xi/getselev.c +++ b/Xi/getselev.c @@ -128,6 +128,8 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) sizeof(XEventClass); rep.length = bytes_to_int32(total_length); buf = calloc(1, total_length); + if (!buf) + return BadAlloc; tclient = buf; aclient = buf + rep.this_client_count;