From 30f2aff526c10e5b594bac42a5a2c1f0244a94bb Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 20 Jan 2006 18:34:42 +0000 Subject: [PATCH] fix invalid value of prev_q (issue #6302) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@8347 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_queue.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/app_queue.c b/apps/app_queue.c index f34e6a0b2c..37611e6716 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -763,20 +763,17 @@ static void rt_handle_member_record(struct ast_call_queue *q, char *interface, c static struct ast_call_queue *reload_queue_rt(const char *queuename, struct ast_variable *queue_vars, struct ast_config *member_config) { struct ast_variable *v; - struct ast_call_queue *q, *prev_q; + struct ast_call_queue *q, *prev_q = NULL; struct member *m, *prev_m, *next_m; char *interface; char *tmp, *tmp_name; char tmpbuf[64]; /* Must be longer than the longest queue param name. */ /* Find the queue in the in-core list (we will create a new one if not found). */ - q = queues; - prev_q = NULL; - while (q) { + for (q = queues; q; q = q->next) { if (!strcasecmp(q->name, queuename)) { break; } - q = q->next; prev_q = q; }