[Asterisk-cvs] asterisk/channels chan_iax2.c,1.91,1.91.2.1

markster at lists.digium.com markster at lists.digium.com
Fri Feb 6 14:59:43 CST 2004


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

Modified Files:
      Tag: v1-0_stable
	chan_iax2.c 
Log Message:
Don't free/unlink IAX2 structures until zt_hangup is called.


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.91
retrieving revision 1.91.2.1
diff -u -d -r1.91 -r1.91.2.1
--- chan_iax2.c	3 Feb 2004 15:16:04 -0000	1.91
+++ chan_iax2.c	6 Feb 2004 21:08:26 -0000	1.91.2.1
@@ -1038,9 +1038,11 @@
 			goto retry;
 		}
 	}
-	iaxs[callno] = NULL;
+	if (!owner)
+		iaxs[callno] = NULL;
 	if (pvt) {
-		pvt->owner = NULL;
+		if (!owner)
+			pvt->owner = NULL;
 		/* No more pings or lagrq's */
 		if (pvt->pingid > -1)
 			ast_sched_del(sched, pvt->pingid);
@@ -1063,7 +1065,6 @@
 
 		if (owner) {
 			/* If there's an owner, prod it to give up */
-			owner->pvt->pvt = NULL;
 			owner->_softhangup |= AST_SOFTHANGUP_DEV;
 			ast_queue_hangup(owner, 0);
 		}
@@ -1076,7 +1077,8 @@
 		if (pvt->reg) {
 			pvt->reg->callno = 0;
 		}
-		free(pvt);
+		if (!owner)
+			free(pvt);
 	}
 	if (owner) {
 		ast_mutex_unlock(&owner->lock);




More information about the svn-commits mailing list