[asterisk-commits] russell: branch murf/bug11210 r99405 - /team/murf/bug11210/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 22 10:39:50 CST 2008


Author: russell
Date: Mon Jan 21 15:56:28 2008
New Revision: 99405

URL: http://svn.digium.com/view/asterisk?view=rev&rev=99405
Log:
Add missing locking in a CLI completion handler

Modified:
    team/murf/bug11210/channels/chan_sip.c

Change Statistics:
 team/murf/bug11210/channels/chan_sip.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Modified: team/murf/bug11210/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_sip.c?view=diff&rev=99405&r1=99404&r2=99405
==============================================================================
--- team/murf/bug11210/channels/chan_sip.c (original)
+++ team/murf/bug11210/channels/chan_sip.c Mon Jan 21 15:56:28 2008
@@ -13517,11 +13517,14 @@
 	i = ao2_iterator_init(dialogs, 0);
 	
 	while ((cur = ao2_t_iterator_next(&i, "iterate thru dialogs"))) {
+		sip_pvt_lock(cur);
 		if (!strncasecmp(word, cur->callid, wordlen) && ++which > state) {
 			c = ast_strdup(cur->callid);
-			ao2_t_ref(cur,-1,"drop ref in iterator loop break");
+			sip_pvt_unlock(cur);
+			ao2_t_ref(cur, -1, "drop ref in iterator loop break");
 			break;
 		}
+		sip_pvt_unlock(cur);
 		ao2_t_ref(cur,-1, "drop ref in iterator loop");
 	}
 	return c;




More information about the asterisk-commits mailing list