summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2015-04-09 02:05:26 +0000
committerMatthew Jordan <mjordan@digium.com>2015-04-09 02:05:26 +0000
commit2201e2734077c07648029f165d1a6a89f99e07c0 (patch)
tree359de0c1bd1fa362946fbe91ae0c2fc33ed021c1 /apps/app_queue.c
parenta759714101741365edc6337ed7540422e41c0701 (diff)
apps/app_queue: Prevent possible crash when evaluating queue penalty rules
Although it only occurred once, a crash occurred when a queue attempted to evaluate a queue penalty rule that appeared to have already been destroyed. In many locations in app_queue, a test is done to see if qe->pr is NULL; however, when we dispose of a queue's penalty rules, we don't set the pointer to NULL after free'ing it. This patch does that to prevent any dangling pointers from lingering on the queue object. Review: https://reviewboard.asterisk.org/r/4522 ASTERISK-23319 #close Reported by: Vadim patches: rb4552.patch submitted by Stefan Engström (License 6691) ........ Merged revisions 434448 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 434449 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 1c42f8c61..3aa30b0ac 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -3941,6 +3941,7 @@ static void leave_queue(struct queue_ent *qe)
while ((pr_iter = AST_LIST_REMOVE_HEAD(&qe->qe_rules, list))) {
ast_free(pr_iter);
}
+ qe->pr = NULL;
snprintf(posstr, sizeof(posstr), "%d", qe->pos);
pbx_builtin_setvar_helper(qe->chan, "QUEUEPOSITION", posstr);
} else {