Free the translators on the ast_closestream
authorMartin Pycko <martinp@digium.com>
Mon, 11 Aug 2003 20:24:14 +0000 (20:24 +0000)
committerMartin Pycko <martinp@digium.com>
Mon, 11 Aug 2003 20:24:14 +0000 (20:24 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1290 65c4cc65-6c06-0410-ace0-fbb531ad65f3

file.c

diff --git a/file.c b/file.c
index f0d3242..314ad7f 100755 (executable)
--- a/file.c
+++ b/file.c
@@ -627,6 +627,11 @@ int ast_closestream(struct ast_filestream *f)
                        f->owner->vstreamid = -1;
                }
        }
+       /* destroy the translator on exit */
+       if (f->trans) {
+               ast_translator_free_path(f->trans);
+               f->trans = NULL;
+       }
        if (f->filename)
                free(f->filename);
        f->filename = NULL;