[Python-checkins] r60042 - python/trunk/Modules/main.c

christian.heimes python-checkins at python.org
Fri Jan 18 09:53:46 CET 2008


Author: christian.heimes
Date: Fri Jan 18 09:53:45 2008
New Revision: 60042

Modified:
   python/trunk/Modules/main.c
Log:
Coverity CID #168
leaked_storage: Returned without freeing storage "fp"

Modified: python/trunk/Modules/main.c
==============================================================================
--- python/trunk/Modules/main.c	(original)
+++ python/trunk/Modules/main.c	Fri Jan 18 09:53:45 2008
@@ -565,6 +565,7 @@
 				if (fstat(fileno(fp), &sb) == 0 &&
 				    S_ISDIR(sb.st_mode)) {
 					fprintf(stderr, "%s: '%s' is a directory, cannot continue\n", argv[0], filename);
+					fclose(fp);
 					return 1;
 				}
 			}


More information about the Python-checkins mailing list