diff options
-rw-r--r-- | main/file.c | 1 | ||||
-rw-r--r-- | main/translate.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/main/file.c b/main/file.c index 332f28441..15cf7fadd 100644 --- a/main/file.c +++ b/main/file.c @@ -205,6 +205,7 @@ int ast_writestream(struct ast_filestream *fs, struct ast_frame *f) trf = ast_translate(fs->trans, f, 0); if (trf) { res = fs->fmt->write(fs, trf); + ast_frfree(trf); if (res) ast_log(LOG_WARNING, "Translated frame write failed\n"); } else diff --git a/main/translate.c b/main/translate.c index 9f8219b12..0aa21df12 100644 --- a/main/translate.c +++ b/main/translate.c @@ -355,6 +355,8 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f, delivery = f->delivery; for ( ; out && p ; p = p->next) { framein(p, out); + if (out != f) + ast_frfree(out); out = p->t->frameout(p); } if (consume) |