[svn-commits] mmichelson: trunk r263860 - /trunk/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue May 18 16:09:45 CDT 2010


Author: mmichelson
Date: Tue May 18 16:09:41 2010
New Revision: 263860

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=263860
Log:
Be sure to heap-allocate the redirecting to tag so as not to cause crashiness.


Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=263860&r1=263859&r2=263860
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue May 18 16:09:41 2010
@@ -17540,6 +17540,10 @@
 			ast_free(redirecting->from.tag);
 		}
 		redirecting->from.tag = ast_strdup(p->cid_tag);
+		if (redirecting->to.tag) {
+			ast_free(redirecting->to.tag);
+		}
+		redirecting->to.tag = ast_strdup(p->cid_tag);
 	}
 	if (!ast_strlen_zero(redirecting_to_number)) {
 		if (redirecting->to.number) {
@@ -17555,7 +17559,6 @@
 		ast_debug(3, "Got redirecting to name %s\n", redirecting_from_number);
 		redirecting->to.name = redirecting_to_name;
 	}
-	redirecting->to.tag = (char *) p->cid_tag;
 	redirecting->reason = reason;
 }
 




More information about the svn-commits mailing list