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

markster at lists.digium.com markster at lists.digium.com
Fri Feb 6 12:02:30 CST 2004


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

Modified Files:
	chan_iax2.c 
Log Message:
Don't free private structure until iax2_hangup is actually called


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- chan_iax2.c	3 Feb 2004 15:16:04 -0000	1.91
+++ chan_iax2.c	6 Feb 2004 18:11:13 -0000	1.92
@@ -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