diff --git a/apps/app_queue.c b/apps/app_queue.c index dc7a0a074a..dfc1a0b250 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3486,7 +3486,9 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte if (o->stillgoing) { /* Keep track of important channels */ stillgoing = 1; if (o->chan) { - watchers[pos++] = o->chan; + if (pos < AST_MAX_WATCHERS) { + watchers[pos++] = o->chan; + } if (!start) start = o; else