From: Russell Bryant Date: Wed, 24 Nov 2010 23:28:19 +0000 (+0000) Subject: Merged revisions 296213 via svnmerge from X-Git-Tag: 1.6.2.16-rc1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=639b5c84c9976b76bf682ccc60827cdbea10066c;p=thirdparty%2Fasterisk.git 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/branches/1.6.2@296221 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/channel.c b/main/channel.c index 211a3ab704..858e96936e 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) { /*