summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2007-09-13 13:34:24 +0000
committerRussell Bryant <russell@russellbryant.com>2007-09-13 13:34:24 +0000
commita0e8ee0a3d25e4e2386fa97c37869c7910ed6466 (patch)
treee4ccd777cdd5b50d68e3c2f797847af8a8d44966 /apps
parent5734c0df49fb9054ef9c687cb1d885102c248e25 (diff)
Fix a missing unref of a member struct. This was pointed out by Marta. Thanks!
This function in 1.4 didn't have the problem. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index adf752556..0f3f82446 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -514,21 +514,17 @@ static enum queue_member_status get_member_status(struct call_queue *q, int max_
ast_mutex_lock(&q->lock);
mem_iter = ao2_iterator_init(q->members, 0);
- while ((member = ao2_iterator_next(&mem_iter))) {
- if (max_penalty && (member->penalty > max_penalty)) {
- ao2_ref(member, -1);
+ for (; (member = ao2_iterator_next(&mem_iter)); ao2_ref(member, -1)) {
+ if (max_penalty && (member->penalty > max_penalty))
continue;
- }
switch (member->status) {
case AST_DEVICE_INVALID:
/* nothing to do */
- ao2_ref(member, -1);
break;
case AST_DEVICE_UNAVAILABLE:
if (result != QUEUE_NO_UNPAUSED_REACHABLE_MEMBERS)
result = QUEUE_NO_REACHABLE_MEMBERS;
- ao2_ref(member, -1);
break;
default:
if (member->paused) {