diff --git a/record/record.c b/record/record.c index 3a1b00516..757fde1fe 100644 --- a/record/record.c +++ b/record/record.c @@ -2729,7 +2729,8 @@ RecordAClientStateChange(CallbackListPtr *pcbl, void *nulldata, case ClientStateRetained: /* client disconnected */ /* RecordDisableContext modifies contents of ppAllContexts. */ - numContextsCopy = numContexts; + if (!(numContextsCopy = numContexts)) + break; ppAllContextsCopy = xallocarray(numContextsCopy, sizeof(RecordContextPtr)); assert(ppAllContextsCopy);