[asterisk-commits] russell: branch 1.4 r296213 - /branches/1.4/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 24 17:26:49 CST 2010


Author: russell
Date: Wed Nov 24 17:26:43 2010
New Revision: 296213

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=296213
Log:
Make Asterisk less crashy.

Since we might not put a new translation path on the channel, go ahead and
set it to NULL right after destroying the old one to ensure we don't try
to free an invalid translation path later on.

Modified:
    branches/1.4/main/channel.c

Modified: branches/1.4/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/main/channel.c?view=diff&rev=296213&r1=296212&r2=296213
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Wed Nov 24 17:26:43 2010
@@ -3400,8 +3400,10 @@
 	/* User perspective is fmt */
 	*format = fmt;
 	/* Free any read translation we have right now */
-	if (*trans)
+	if (*trans) {
 		ast_translator_free_path(*trans);
+		*trans = NULL;
+	}
 	/* Build a translation path from the raw format to the desired format */
 	if (*format == *rawformat) {
 		/*




More information about the asterisk-commits mailing list