mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 12:25:07 +00:00
(1823) record: protect from memory allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -2713,7 +2713,8 @@ RecordAClientStateChange(CallbackListPtr *pcbl, void *nulldata,
|
||||
/* RecordDisableContext modifies contents of ppAllContexts. */
|
||||
if (!(numContextsCopy = numContexts))
|
||||
break;
|
||||
ppAllContextsCopy = calloc(numContextsCopy, sizeof(RecordContextPtr));
|
||||
if (!(ppAllContextsCopy = calloc(numContextsCopy, sizeof(RecordContextPtr))))
|
||||
return;
|
||||
assert(ppAllContextsCopy);
|
||||
memcpy(ppAllContextsCopy, ppAllContexts,
|
||||
numContextsCopy * sizeof(RecordContextPtr));
|
||||
|
||||
Reference in New Issue
Block a user