summaryrefslogtreecommitdiff
path: root/Modules/main.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-10-12 03:03:23 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2007-10-12 03:03:23 +0000
commite545ff30a629f9d41a15c409ed9780eaf505b329 (patch)
tree0e9d6ff6e65c2003393091b55d0fe2927696c9e9 /Modules/main.c
parent088beae1f2b99e4dea44fe3f6630f22f5f49b013 (diff)
downloadcpython-git-e545ff30a629f9d41a15c409ed9780eaf505b329.tar.gz
Fix Coverity 168: Close the file before returning (exiting).
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 59b0e9f2ed..417b3f2bf3 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -416,6 +416,7 @@ Py_Main(int argc, char **argv)
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;
}
}