[asterisk-commits] tilghman: trunk r176320 - /trunk/channels/chan_skinny.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 16 17:14:08 CST 2009


Author: tilghman
Date: Mon Feb 16 17:14:08 2009
New Revision: 176320

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=176320
Log:
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

Modified:
    trunk/channels/chan_skinny.c

Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=176320&r1=176319&r2=176320
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Mon Feb 16 17:14:08 2009
@@ -5869,9 +5869,9 @@
 {
 	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 @@
 			ast_log(LOG_WARNING, "Trying to delete nonexistent session %p?\n", s);
 		}
 	}
+	AST_LIST_TRAVERSE_SAFE_END
 	AST_LIST_UNLOCK(&sessions);
 }
 




More information about the asterisk-commits mailing list