]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Destroy variables on a sip_pvt before copying vars from the sip_peer.
authorRussell Bryant <russell@russellbryant.com>
Fri, 6 May 2011 20:01:16 +0000 (20:01 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 6 May 2011 20:01:16 +0000 (20:01 +0000)
Don't duplicate variables on the sip_pvt.  Just reset the variable list each
time.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@317867 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index ca5dc72c97e2f67346f1868ab983e6599d1897ef..c158bee25fe62a3c6f890395249d421c9b87ead1 100644 (file)
@@ -15324,7 +15324,8 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
                ast_string_field_set(p, authname, peer->name);
 
                if (sipmethod == SIP_INVITE) {
-                       /* copy channel vars */
+                       /* destroy old channel vars and copy in new ones. */
+                       ast_variables_destroy(p->chanvars);
                        p->chanvars = copy_vars(peer->chanvars);
                }