aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-11-24 23:29:44 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-11-24 23:29:44 +0000
commitd42d916c4299c18155ae03b3e650788bd4880304 (patch)
tree35c193ce9738fb5da62fda3a031722f9cb2cfebb
parent6c22f5005ef88d7ea05cb80ca3ea74e84b4715df (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.8@296230 f38db490-d61c-443f-a65b-d21fe96a405b
-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) {
/*