[svn-commits] russell: branch 1.4 r128795 - /branches/1.4/channels/chan_iax2.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 7 17:41:48 CDT 2008


Author: russell
Date: Mon Jul  7 17:41:48 2008
New Revision: 128795

URL: http://svn.digium.com/view/asterisk?view=rev&rev=128795
Log:
Fix handling of when a pvt disappears.  Properly return the pvt locked
and don't hold the pvt lock while destroying the ast_channel.

(closes issue #13014)
Reported by: jpgrayson
Patches:
      chan_iax2_ast_iax2_new2.patch uploaded by jpgrayson (license 492)

Modified:
    branches/1.4/channels/chan_iax2.c

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=128795&r1=128794&r2=128795
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Mon Jul  7 17:41:48 2008
@@ -3766,11 +3766,13 @@
 	ast_mutex_unlock(&iaxsl[callno]);
 	tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, "IAX2/%s-%d", i->host, i->callno);
 	ast_mutex_lock(&iaxsl[callno]);
-	if (!iaxs[callno]) {
+	if (i != iaxs[callno]) {
 		if (tmp) {
+			/* unlock and relock iaxsl[callno] to preserve locking order */
+			ast_mutex_unlock(&iaxsl[callno]);
 			ast_channel_free(tmp);
-		}
-		ast_mutex_unlock(&iaxsl[callno]);
+			ast_mutex_lock(&iaxsl[callno]);
+		}
 		return NULL;
 	}
 




More information about the svn-commits mailing list