apps/app_queue: Prevent possible crash when evaluating queue penalty rules
[asterisk/asterisk.git] / apps / app_queue.c
index 1c42f8c..3aa30b0 100644 (file)
@@ -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 {