summaryrefslogtreecommitdiff
path: root/record
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2019-10-15 13:21:37 -0400
committerAdam Jackson <ajax@redhat.com>2019-10-15 14:06:44 -0400
commitf44ac101c523a0439bd1a864850e3c1a4e154549 (patch)
tree4afb6dc0a2089c2f98852e61ef9ecf53e2a7458b /record
parent9155e0c7c6696ec8c657e32bf41a08f88a8f3d0d (diff)
record: Fix undefined memcpy in RecordAClientStateChange
If we don't have any recording contexts just skip all this. Note this also skips a pointless trip through malloc(0)/free.
Diffstat (limited to 'record')
-rw-r--r--record/record.c3
1 files changed, 2 insertions, 1 deletions
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);