[Asterisk-cvs] asterisk/channels chan_zap.c,1.500,1.501

mattf mattf
Tue Sep 6 13:50:28 CDT 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv22041/channels

Modified Files:
	chan_zap.c 
Log Message:
Fixed possible hangup race condition that would lead to segfualt with hangups.


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.500
retrieving revision 1.501
diff -u -d -r1.500 -r1.501
--- chan_zap.c	2 Sep 2005 19:38:08 -0000	1.500
+++ chan_zap.c	6 Sep 2005 17:50:55 -0000	1.501
@@ -2347,6 +2347,7 @@
 								icause = atoi(cause);
 						}
 						pri_hangup(p->pri->pri, p->call, icause);
+						p->call = NULL;
 					}
 					if (res < 0) 
 						ast_log(LOG_WARNING, "pri_disconnect failed\n");
@@ -3463,6 +3464,7 @@
 					if (!pri_grab(p, p->pri)) {
 						pri_hangup(p->pri->pri, p->call, -1);
 						pri_destroycall(p->pri->pri, p->call);
+						p->call = NULL;
 						pri_rel(p->pri);
 					} else
 						ast_log(LOG_WARNING, "Failed to grab PRI!\n");
@@ -3471,7 +3473,6 @@
 			}
 			if (p->owner)
 				p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
-			p->call = NULL;
 			if (p->bearer)
 				p->bearer->inalarm = 1;
 			else




More information about the svn-commits mailing list