diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-31 23:10:06 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-31 23:10:06 +0000 |
commit | ea2e6eb3487d7c9439bb3ce6e09df803f3caa4c0 (patch) | |
tree | 912491e69e14b52b3fa973454505534071393a26 | |
parent | 1552ee776cd8de959b6d9f07677644a5344fac5c (diff) |
Fix a couple of places where ast_frfree() was not called on a frame that came
from a translator. This showed itself by g729 decoders not getting released.
Since the flag inside the translator frame never got unset by freeing the frame
to indicate it was no longer in use, the translators never got destroyed, and
thus the g729 licenses were not released.
(closes issue #11892)
Reported by: xrg
Patches:
11892.diff uploaded by russell (license 2)
Tested by: xrg, russell
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@101601 f38db490-d61c-443f-a65b-d21fe96a405b
-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) |