From: Russell Bryant Date: Tue, 26 May 2009 18:30:04 +0000 (+0000) Subject: Merged revisions 196843 via svnmerge from X-Git-Tag: 1.6.1.3-rc1~213 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8716bb7b200bb2b25f3ed8852243ed904a30a6be;p=thirdparty%2Fasterisk.git Merged revisions 196843 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r196843 | russell | 2009-05-26 13:20:57 -0500 (Tue, 26 May 2009) | 16 lines Merged revisions 196826 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r196826 | russell | 2009-05-26 13:14:36 -0500 (Tue, 26 May 2009) | 9 lines Resolve a file handle leak. The frames here should have always been freed. However, out of luck, there was never any memory leaked. However, after file streams became reference counted, this code would leak the file stream for the file being read. (closes issue #15181) Reported by: jkroon ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@196869 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_convert.c b/res/res_convert.c index 0b4d664ff2..264089c7fc 100644 --- a/res/res_convert.c +++ b/res/res_convert.c @@ -117,9 +117,11 @@ static char *handle_cli_file_convert(struct ast_cli_entry *e, int cmd, struct as while ((f = ast_readframe(fs_in))) { if (ast_writestream(fs_out, f)) { + ast_frfree(f); ast_cli(a->fd, "Failed to convert %s.%s to %s.%s!\n", name_in, ext_in, name_out, ext_out); goto fail_out; } + ast_frfree(f); } cost = ast_tvdiff_ms(ast_tvnow(), start);