summaryrefslogtreecommitdiff
path: root/main/file.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2009-01-07 22:36:34 +0000
committerRussell Bryant <russell@russellbryant.com>2009-01-07 22:36:34 +0000
commitb0a8b26ac2cd45103eb5d326c3e757c37ec4f7b7 (patch)
tree132c8ac15cefc55b6165c683d48013e5c530ccbb /main/file.c
parent90431add277fa50f16b974c3c78193117e4befca (diff)
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: https://origsvn.digium.com/svn/asterisk/trunk@167569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/file.c')
-rw-r--r--main/file.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/main/file.c b/main/file.c
index ee9d5d9fa..995ba4a0c 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;