aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-26 18:14:36 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-26 18:14:36 +0000
commitcbfc009b09ec786ae0cdbbd9ba4e9dd390fbaeb2 (patch)
tree657790b1937945f5e3e2cbb74933a576c6ed6763
parente442a1431a8f42fd7a1d7d3fe6772bbe2056aad1 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@196826 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_convert.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_convert.c b/res/res_convert.c
index 7c4e04e83..8f76b2317 100644
--- a/res/res_convert.c
+++ b/res/res_convert.c
@@ -100,9 +100,11 @@ static int cli_audio_convert_deprecated(int fd, int argc, char *argv[])
while ((f = ast_readframe(fs_in))) {
if (ast_writestream(fs_out, f)) {
+ ast_frfree(f);
ast_cli(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);
@@ -167,9 +169,11 @@ static int cli_audio_convert(int fd, int argc, char *argv[])
while ((f = ast_readframe(fs_in))) {
if (ast_writestream(fs_out, f)) {
+ ast_frfree(f);
ast_cli(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);