aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) {
/*