[asterisk-commits] russell: branch 1.2 r73768 - /branches/1.2/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 6 18:01:22 CDT 2007


Author: russell
Date: Fri Jul  6 18:01:22 2007
New Revision: 73768

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73768
Log:
If a sip_pvt struct has already registered an extension state callback,
remove the old one before adding a new one.  If this isn't done, Asterisk
will crash.  (issue #10120)

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?view=diff&rev=73768&r1=73767&r2=73768
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Fri Jul  6 18:01:22 2007
@@ -11191,8 +11191,11 @@
 				ast_set_flag(p, SIP_NEEDDESTROY);	
 				return 0;
 			}
-			if (p->subscribed != NONE)
+			if (p->subscribed != NONE) {
+				if (p->stateid > -1)
+					ast_extension_state_del(p->stateid, cb_extensionstate);
 				p->stateid = ast_extension_state_add(p->context, p->exten, cb_extensionstate, p);
+			}
 		}
 	}
 




More information about the asterisk-commits mailing list