[asterisk-commits] mmichelson: trunk r103908 - in /trunk: ./ channels/chan_local.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 20 15:41:31 CST 2008


Author: mmichelson
Date: Wed Feb 20 15:41:31 2008
New Revision: 103908

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103908
Log:
Merged revisions 103904 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r103904 | mmichelson | 2008-02-20 15:40:08 -0600 (Wed, 20 Feb 2008) | 6 lines

Fix a crash if the channel becomes NULL while attempting to lock it.

(closes issue #12039)
Reported by: danpwi


........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_local.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_local.c?view=diff&rev=103908&r1=103907&r2=103908
==============================================================================
--- trunk/channels/chan_local.c (original)
+++ trunk/channels/chan_local.c Wed Feb 20 15:41:31 2008
@@ -511,13 +511,15 @@
 		const char *status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS");
 		if ((status) && (p->owner)) {
 			/* Deadlock avoidance */
-			while (ast_channel_trylock(p->owner)) {
+			while (p->owner && ast_channel_trylock(p->owner)) {
 				ast_mutex_unlock(&p->lock);
 				usleep(1);
 				ast_mutex_lock(&p->lock);
 			}
-			pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status);
-			ast_channel_unlock(p->owner);
+			if (p->owner) {
+				pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status);
+				ast_channel_unlock(p->owner);
+			}
 		}
 		p->chan = NULL;
 		ast_clear_flag(p, LOCAL_LAUNCHED_PBX);




More information about the asterisk-commits mailing list