[asterisk-commits] russell: branch 1.4 r167566 - /branches/1.4/main/file.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 7 16:35:37 CST 2009


Author: russell
Date: Wed Jan  7 16:35:36 2009
New Revision: 167566

URL: http://svn.digium.com/view/asterisk?view=rev&rev=167566
Log:
Fix the last couple of places where free() was improperly used directly.

Modified:
    branches/1.4/main/file.c

Modified: branches/1.4/main/file.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/file.c?view=diff&rev=167566&r1=167565&r2=167566
==============================================================================
--- branches/1.4/main/file.c (original)
+++ branches/1.4/main/file.c Wed Jan  7 16:35:36 2009
@@ -969,11 +969,11 @@
 		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 @@
 					unlink(fn);
 					unlink(orig_fn);
 				}
-				if (fs)
-					ast_free(fs);
-				fs = NULL;
+				if (fs) {
+					ast_closestream(fs);
+					fs = NULL;
+				}
 				continue;
 			}
 			fs->trans = NULL;




More information about the asterisk-commits mailing list