diff --git a/main/file.c b/main/file.c index daffb766d3ea51d64f8f1c381983c0e69ab5124d..6b37f160268b8550be6b0a1df15c27deaafc2d51 100644 --- a/main/file.c +++ b/main/file.c @@ -188,6 +188,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 1af88ecfb8bfa9ebff413b76939cf3f7c33ccf80..6de444ff501e7e21397f8d5d2ce8bf42b8257dbd 100644 --- a/main/translate.c +++ b/main/translate.c @@ -347,6 +347,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)