gh-98872: Fix a possible resource leak in Python 3.11.0 (GH-99047)

Issue: #98872

Automerge-Triggered-By: GH:kumaraditya303
This commit is contained in:
SQLPATCH 2022-11-24 17:04:19 +08:00 committed by GitHub
parent b4d54a332e
commit 4e5f2db6f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -0,0 +1 @@
Fix a possible fd leak in ``Programs/_freeze_module.c`` introduced in Python 3.11.

View file

@ -194,6 +194,7 @@ write_frozen(const char *outpath, const char *inpath, const char *name,
if (ferror(outfile)) {
fprintf(stderr, "error when writing to '%s'\n", outpath);
fclose(outfile);
return -1;
}
fclose(outfile);