]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a couple of places where ast_frfree() was not called on a frame that came
authorRussell Bryant <russell@russellbryant.com>
Thu, 31 Jan 2008 23:10:06 +0000 (23:10 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 31 Jan 2008 23:10:06 +0000 (23:10 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@101601 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/file.c
main/translate.c

index 332f284414732cb4539b639c23ff407e4fb70142..15cf7fadd23c1b78e3c4e642a4ab9f6ecfa67af2 100644 (file)
@@ -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
index 9f8219b12dd9f174d29b3fd66e417d193b739d36..0aa21df122f32dfe9644db34f5209e1e6a85874b 100644 (file)
@@ -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)