[svn-commits] dvossel: branch 1.4 r320055 - /branches/1.4/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri May 20 11:38:34 CDT 2011


Author: dvossel
Date: Fri May 20 11:38:28 2011
New Revision: 320055

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=320055
Log:
chan_sip: Destroy variables on a sip_pvt before copying vars from the sip_peer.

(closes issue #19202)
Reported by: wdoekes
Patches: 
      issue19202_destroy_challenged_invite_chanvars.patch uploaded by wdoekes (license 717)



Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=320055&r1=320054&r2=320055
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Fri May 20 11:38:28 2011
@@ -10749,7 +10749,9 @@
 		ast_copy_flags(&p->flags[0], &user->flags[0], SIP_FLAGS_TO_COPY);
 		ast_copy_flags(&p->flags[1], &user->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
 		if (sipmethod == SIP_INVITE) {
-			/* copy channel vars */
+			/* destroy old channel vars and copy new channel vars */
+			ast_variables_destroy(p->chanvars);
+			p->chanvars = NULL;
 			for (v = user->chanvars ; v ; v = v->next) {
 				if ((tmpvar = ast_variable_new(v->name, v->value))) {
 					tmpvar->next = p->chanvars; 
@@ -10909,7 +10911,9 @@
 				ast_string_field_set(p, authname, peer->name);
 
 				if (sipmethod == SIP_INVITE) {
-					/* copy channel vars */
+					/* destroy old channel vars and copy new channel vars */
+					ast_variables_destroy(p->chanvars);
+					p->chanvars = NULL;
 					for (v = peer->chanvars ; v ; v = v->next) {
 						if ((tmpvar = ast_variable_new(v->name, v->value))) {
 							tmpvar->next = p->chanvars; 




More information about the svn-commits mailing list