summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2010-11-24 23:30:32 +0000
committerRussell Bryant <russell@russellbryant.com>2010-11-24 23:30:32 +0000
commit10f375f8391c235e5c04d171607c1cf9a349892c (patch)
tree2295f8270c35afb0d8980fc41fdda9989119e1b0
parentccdc417ab57102d11d055dbaec943bf6adfdd337 (diff)
Merged revisions 296230 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r296230 | russell | 2010-11-24 17:29:44 -0600 (Wed, 24 Nov 2010) | 20 lines Merged revisions 296221 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r296221 | russell | 2010-11-24 17:28:19 -0600 (Wed, 24 Nov 2010) | 13 lines Merged revisions 296213 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r296213 | russell | 2010-11-24 17:26:43 -0600 (Wed, 24 Nov 2010) | 6 lines 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. ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@296235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--main/channel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 259a9f324..e6eb214ce 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -4991,8 +4991,10 @@ static int set_format(struct ast_channel *chan, format_t fmt, format_t *rawforma
/* 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) {
/*