[asterisk-commits] kpfleming: trunk r47702 - in /trunk: ./ main/file.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Nov 15 13:51:18 MST 2006


Author: kpfleming
Date: Wed Nov 15 14:51:18 2006
New Revision: 47702

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47702
Log:
Merged revisions 47701 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47701 | kpfleming | 2006-11-15 14:50:06 -0600 (Wed, 15 Nov 2006) | 2 lines

don't try to call fclose() if fopen() failed

........

Modified:
    trunk/   (props changed)
    trunk/main/file.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/file.c
URL: http://svn.digium.com/view/asterisk/trunk/main/file.c?view=diff&rev=47702&r1=47701&r2=47702
==============================================================================
--- trunk/main/file.c (original)
+++ trunk/main/file.c Wed Nov 15 14:51:18 2006
@@ -830,12 +830,13 @@
 		errno = 0;
 		bfile = fopen(fn, "r");
 		if (!bfile || (fs = get_filestream(f, bfile)) == NULL ||
-			open_wrapper(fs) ) {
+		    open_wrapper(fs) ) {
 			ast_log(LOG_WARNING, "Unable to open %s\n", fn);
-			fclose(bfile);
-			free(fn);
 			if (fs)
 				free(fs);
+			if (bfile)
+				fclose(bfile);
+			free(fn);
 			continue;
 		}
 		/* found it */



More information about the asterisk-commits mailing list