[asterisk-commits] russell: branch 1.6.0 r107160 - in /branches/1.6.0: ./ main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 10 15:05:38 CDT 2008


Author: russell
Date: Mon Mar 10 15:05:37 2008
New Revision: 107160

URL: http://svn.digium.com/view/asterisk?view=rev&rev=107160
Log:
Merged revisions 107159 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r107159 | russell | 2008-03-10 15:05:12 -0500 (Mon, 10 Mar 2008) | 17 lines

Merged revisions 107158 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r107158 | russell | 2008-03-10 15:04:27 -0500 (Mon, 10 Mar 2008) | 9 lines

Fix some bugs related to originating calls.  If the code failed to start a PBX
on the channel (such as if you set a call limit based on the system's load
average), then there were cases where a channel that has already been free'd
using ast_hangup() got accessed.  This caused weird memory corruption and
crashes to occur.

(fixes issue BE-386)
(much debugging credit goes to twilson, final patch written by me)

........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/main/pbx.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/main/pbx.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/pbx.c?view=diff&rev=107160&r1=107159&r2=107160
==============================================================================
--- branches/1.6.0/main/pbx.c (original)
+++ branches/1.6.0/main/pbx.c Mon Mar 10 15:05:37 2008
@@ -6430,6 +6430,7 @@
 						if (channel)
 							*channel = NULL;
 						ast_hangup(chan);
+						chan = NULL;
 						res = -1;
 					}
 				} else {
@@ -6440,6 +6441,7 @@
 							ast_channel_unlock(chan);
 						}
 						ast_hangup(chan);
+						chan = NULL;
 						res = -1;
 					}
 				}
@@ -6458,6 +6460,7 @@
 					ast_channel_unlock(chan);
 				}
 				ast_hangup(chan);
+				chan = NULL;
 			}
 		}
 
@@ -6485,7 +6488,11 @@
 					pbx_builtin_setvar_helper(chan, "REASON", failed_reason);
 					if (account)
 						ast_cdr_setaccount(chan, account);
-					ast_pbx_run(chan);
+					if (ast_pbx_run(chan)) {
+						ast_log(LOG_ERROR, "Unable to run PBX on %s\n", chan->name);
+						ast_hangup(chan);
+					}
+					chan = NULL;
 				}
 			}
 		}




More information about the asterisk-commits mailing list