xi: protect from allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
a222349c43
commit
eb5ebae908
|
@ -117,6 +117,8 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||||
if (count) {
|
if (count) {
|
||||||
rep.count = count;
|
rep.count = count;
|
||||||
buf = calloc(rep.count, sizeof(XEventClass));
|
buf = calloc(rep.count, sizeof(XEventClass));
|
||||||
|
if (!buf)
|
||||||
|
return BadAlloc;
|
||||||
rep.length = bytes_to_int32(rep.count * sizeof(XEventClass));
|
rep.length = bytes_to_int32(rep.count * sizeof(XEventClass));
|
||||||
|
|
||||||
tbuf = buf;
|
tbuf = buf;
|
||||||
|
|
Loading…
Reference in New Issue