Skip to content

Commit 97db4ea

Browse files
author
neal.norwitz
committed
Fix Coverity 168: Close the file before returning (exiting).
git-svn-id: http://svn.python.org/projects/python/trunk@58422 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 4d447ab commit 97db4ea

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Modules/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ Py_Main(int argc, char **argv)
416416
if (fstat(fileno(fp), &sb) == 0 &&
417417
S_ISDIR(sb.st_mode)) {
418418
fprintf(stderr, "%s: '%s' is a directory, cannot continue\n", argv[0], filename);
419+
fclose(fp);
419420
return 1;
420421
}
421422
}

0 commit comments

Comments
 (0)