aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-11-24 23:28:19 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-11-24 23:28:19 +0000
commit6b4f93279996b33b8ff609c828ff95a6cf703e1a (patch)
tree0e013f8310897ee4287d0767340eb881b2575da2 /main
parent04bb1bcffe40311959e7f9fb2758a0390d130463 (diff)
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.6.2@296221 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 211a3ab70..858e96936 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3972,8 +3972,10 @@ static int set_format(struct ast_channel *chan, int fmt, int *rawformat, int *fo
/* 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) {
/*