summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-05-31 18:39:30 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-05-31 18:39:30 +0000
commitdd2427c1414d62cd7e3c867f17de9d6dbac844fe (patch)
tree5760fb673e236d0f58b094240de81ca9780cd135 /apps/app_queue.c
parentfdb002a43a819542693815767a0ca9aba135f18c (diff)
Coverity Report: Fix issues for error type REVERSE_INULL (core modules)
* Fixes findings: 0-2,5,7-15,24-26,28-31 (issue ASTERISK-19648) Reported by: Matt Jordan ........ Merged revisions 368039 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368042 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index c59d9c14a..f19ca3fdb 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2721,11 +2721,11 @@ static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result *
*/
if (!inserted && (qe->prio >= cur->prio) && position && (position <= pos + 1)) {
insert_entry(q, prev, qe, &pos);
+ inserted = 1;
/*pos is incremented inside insert_entry, so don't need to add 1 here*/
if (position < pos) {
ast_log(LOG_NOTICE, "Asked to be inserted at position %d but forced into position %d due to higher priority callers\n", position, pos);
}
- inserted = 1;
}
cur->pos = ++pos;
prev = cur;
@@ -6468,6 +6468,8 @@ static int queue_exec(struct ast_channel *chan, const char *data)
set_queue_result(chan, reason);
return 0;
}
+ ast_assert(qe.parent != NULL);
+
ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "ENTERQUEUE", "%s|%s|%d",
S_OR(args.url, ""),
S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, ""),
@@ -6625,12 +6627,13 @@ stop:
if (reason != QUEUE_UNKNOWN)
set_queue_result(chan, reason);
- if (qe.parent) {
- /* every queue_ent is given a reference to it's parent call_queue when it joins the queue.
- * This ref must be taken away right before the queue_ent is destroyed. In this case
- * the queue_ent is about to be returned on the stack */
- qe.parent = queue_unref(qe.parent);
- }
+ /*
+ * every queue_ent is given a reference to it's parent
+ * call_queue when it joins the queue. This ref must be taken
+ * away right before the queue_ent is destroyed. In this case
+ * the queue_ent is about to be returned on the stack
+ */
+ qe.parent = queue_unref(qe.parent);
return res;
}