diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-11-21 02:01:36 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-11-21 02:01:36 +0000 |
commit | d29dcba2f8aa13eb71dcb566aea688a4b0844300 (patch) | |
tree | 0b056b93fe7f76b9c26f2d0dfac749da292cd6f5 | |
parent | 4e294e64a5048c107531c779047895f397bbb440 (diff) |
issue #5787
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7162 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | ChangeLog | 2 | ||||
-rwxr-xr-x | apps/app_record.c | 8 |
2 files changed, 6 insertions, 4 deletions
@@ -1,5 +1,7 @@ 2005-11-20 Russell Bryant <russell@digium.com> + * apps/app_record.c: Don't leak a frame if writing it to the file fails. (issue #5787) + * Makefile: Create the monitor spool directory when the other spool directories are created. * pbx.c.c: Remove some useless checks and unnecessary calls to ast_strlen_zero(). (issue #5805) diff --git a/apps/app_record.c b/apps/app_record.c index 7c50a1d73..85310ea70 100755 --- a/apps/app_record.c +++ b/apps/app_record.c @@ -277,6 +277,7 @@ static int record_exec(struct ast_channel *chan, void *data) if (res) { ast_log(LOG_WARNING, "Problem writing frame\n"); + ast_frfree(f); break; } @@ -295,16 +296,15 @@ static int record_exec(struct ast_channel *chan, void *data) break; } } - } - if (f->frametype == AST_FRAME_VIDEO) { + } else if (f->frametype == AST_FRAME_VIDEO) { res = ast_writestream(s, f); if (res) { ast_log(LOG_WARNING, "Problem writing frame\n"); + ast_frfree(f); break; } - } - if ((f->frametype == AST_FRAME_DTMF) && + } else if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == terminator)) { ast_frfree(f); break; |