aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-16 23:14:08 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-16 23:14:08 +0000
commit52cf2e2e5efe93040a8142ea9fcc13fa2e1734ea (patch)
tree14ae06d6d1585cb781717ee6d799bde951461676 /channels
parent26faefc9a28d7d0f0c9618e1e89a81e55417c052 (diff)
Use the correct list macros for deleting an item from the middle of a list.
(issue #13777) Reported by: pj Patches: 20090203__bug13777.diff.txt uploaded by Corydon76 (license 14) Tested by: pj git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176320 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_skinny.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 654077e8a..fddd78170 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -5869,9 +5869,9 @@ static void destroy_session(struct skinnysession *s)
{
struct skinnysession *cur;
AST_LIST_LOCK(&sessions);
- AST_LIST_TRAVERSE(&sessions, cur, list) {
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&sessions, cur, list) {
if (cur == s) {
- AST_LIST_REMOVE(&sessions, s, list);
+ AST_LIST_REMOVE_CURRENT(list);
if (s->fd > -1)
close(s->fd);
@@ -5882,6 +5882,7 @@ static void destroy_session(struct skinnysession *s)
ast_log(LOG_WARNING, "Trying to delete nonexistent session %p?\n", s);
}
}
+ AST_LIST_TRAVERSE_SAFE_END
AST_LIST_UNLOCK(&sessions);
}