record: protect from memory allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
7b24948dbf
commit
953f0a68dc
|
@ -2712,7 +2712,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));
|
||||
|
|
Loading…
Reference in New Issue