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. */
|
/* RecordDisableContext modifies contents of ppAllContexts. */
|
||||||
if (!(numContextsCopy = numContexts))
|
if (!(numContextsCopy = numContexts))
|
||||||
break;
|
break;
|
||||||
ppAllContextsCopy = calloc(numContextsCopy, sizeof(RecordContextPtr));
|
if (!(ppAllContextsCopy = calloc(numContextsCopy, sizeof(RecordContextPtr))))
|
||||||
|
return;
|
||||||
assert(ppAllContextsCopy);
|
assert(ppAllContextsCopy);
|
||||||
memcpy(ppAllContextsCopy, ppAllContexts,
|
memcpy(ppAllContextsCopy, ppAllContexts,
|
||||||
numContextsCopy * sizeof(RecordContextPtr));
|
numContextsCopy * sizeof(RecordContextPtr));
|
||||||
|
|
Loading…
Reference in New Issue