From 685eda5a544fc79681d633391543d2d19ff80670 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 7 Jan 2009 22:37:14 +0000 Subject: [PATCH] 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@167571 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/file.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/main/file.c b/main/file.c index aeb387371d..fae857ad92 100644 --- a/main/file.c +++ b/main/file.c @@ -955,11 +955,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; } @@ -1069,9 +1069,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; -- 2.47.3