Skip to content

Commit 4504c93

Browse files
committed
fixup! gh-142776: Ensure fp file descriptor is closed on all code paths in import.c
Address review comments and add a NEWS entry
1 parent 4eb3919 commit 4504c93

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a file descriptor leak in import.c

Python/import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4843,7 +4843,7 @@ _imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file)
48434843
#endif
48444844

48454845
finally:
4846-
if (fp) {
4846+
if (fp != NULL) {
48474847
fclose(fp);
48484848
}
48494849
_Py_ext_module_loader_info_clear(&info);

0 commit comments

Comments
 (0)