aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-07 22:35:36 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-07 22:35:36 +0000
commitac2d22ca8946fe34e75752767d64590594c699e3 (patch)
tree7a132af8fa4fdbd9266182aa47a043bfbd296bfe /main
parent87f5227866af7b067b357c0c5475551eed654f40 (diff)
Fix the last couple of places where free() was improperly used directly.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167566 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/file.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/main/file.c b/main/file.c
index 8878fae1b..5836e21e3 100644
--- a/main/file.c
+++ b/main/file.c
@@ -969,11 +969,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;
free(fn);
continue;
}
@@ -1086,9 +1086,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;