diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-07 22:37:54 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-07 22:37:54 +0000 |
commit | 3fa7a6ce94ae65280ca62276f8b9b87600dcb820 (patch) | |
tree | c793ef55f5715ee0acd4c955adca71495ae421e0 /main/file.c | |
parent | 50e52f234f27927a54eb8274db348fe92e1a7594 (diff) |
Merged revisions 167569 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r167569 | russell | 2009-01-07 16:36:34 -0600 (Wed, 07 Jan 2009) | 10 lines
Merged revisions 167566 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r167566 | russell | 2009-01-07 16:35:36 -0600 (Wed, 07 Jan 2009) | 2 lines
Fix the last couple of places where free() was improperly used directly.
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@167573 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/file.c')
-rw-r--r-- | main/file.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/main/file.c b/main/file.c index f87be6319..1fe956b12 100644 --- a/main/file.c +++ b/main/file.c @@ -965,11 +965,11 @@ struct ast_filestream *ast_readfile(const char *filename, const char *type, cons if (!bfile || (fs = get_filestream(f, bfile)) == NULL || open_wrapper(fs) ) { ast_log(LOG_WARNING, "Unable to open %s\n", fn); - if (fs) - ast_free(fs); + if (fs) { + ast_closestream(fs); + } fs = NULL; - if (bfile) - fclose(bfile); + bfile = NULL; ast_free(fn); break; } @@ -1079,9 +1079,10 @@ struct ast_filestream *ast_writefile(const char *filename, const char *type, con unlink(fn); unlink(orig_fn); } - if (fs) - ast_free(fs); - fs = NULL; + if (fs) { + ast_closestream(fs); + fs = NULL; + } continue; } fs->trans = NULL; |