From: Russell Bryant Date: Mon, 21 Nov 2005 02:01:36 +0000 (+0000) Subject: issue #5787 X-Git-Tag: 1.4.0-beta1~3274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d6c054ca8666a3bbedb3d9b1f07bef1049bc0e8;p=thirdparty%2Fasterisk.git issue #5787 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7162 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/ChangeLog b/ChangeLog index 2b06bb80d0..8bdb149262 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2005-11-20 Russell Bryant + * 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 7c50a1d731..85310ea708 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;