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)
if (res) {
ast_log(LOG_WARNING, "Problem writing frame\n");
+ ast_frfree(f);
break;
}
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;