aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-11-24 23:26:43 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-11-24 23:26:43 +0000
commit6b55898dd68d59509cbd9e2091620e14310aaf74 (patch)
treecd9eca6d7dc7a89347ded282d54cbb3486c9cf8e /main
parentaf2eaef462eb9510008e4692c2e2f0e0ee2e01f4 (diff)
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.4@296213 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 175c0bd5e..0e3c315fd 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3400,8 +3400,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) {
/*