diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-07-18 12:14:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-18 12:14:10 (GMT) |
commit | a423ddbdeada8a2fd8657453b9e9f58ba0dd921d (patch) | |
tree | 92bf9ec6a80c41499f73a2d2e599df685ab8c4de /Modules/_stat.c | |
parent | b79f3b36c318be8b27d1737a819e33145193801c (diff) | |
download | cpython-a423ddbdeada8a2fd8657453b9e9f58ba0dd921d.zip cpython-a423ddbdeada8a2fd8657453b9e9f58ba0dd921d.tar.gz cpython-a423ddbdeada8a2fd8657453b9e9f58ba0dd921d.tar.bz2 |
[3.12] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855)
Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time.
(cherry picked from commit 3e65baee72131b49f4ce8ca2da568a6f2001ce93)
Diffstat (limited to 'Modules/_stat.c')
-rw-r--r-- | Modules/_stat.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/_stat.c b/Modules/_stat.c index 4218799..4ec2bd2 100644 --- a/Modules/_stat.c +++ b/Modules/_stat.c @@ -592,17 +592,17 @@ stat_exec(PyObject *module) ADD_INT_MACRO(module, FILE_ATTRIBUTE_TEMPORARY); ADD_INT_MACRO(module, FILE_ATTRIBUTE_VIRTUAL); - if (PyModule_AddObject(module, "IO_REPARSE_TAG_SYMLINK", - PyLong_FromUnsignedLong(IO_REPARSE_TAG_SYMLINK)) < 0) { - return -1; + if (_PyModule_Add(module, "IO_REPARSE_TAG_SYMLINK", + PyLong_FromUnsignedLong(IO_REPARSE_TAG_SYMLINK)) < 0) { + return -1; } - if (PyModule_AddObject(module, "IO_REPARSE_TAG_MOUNT_POINT", - PyLong_FromUnsignedLong(IO_REPARSE_TAG_MOUNT_POINT)) < 0) { - return -1; + if (_PyModule_Add(module, "IO_REPARSE_TAG_MOUNT_POINT", + PyLong_FromUnsignedLong(IO_REPARSE_TAG_MOUNT_POINT)) < 0) { + return -1; } - if (PyModule_AddObject(module, "IO_REPARSE_TAG_APPEXECLINK", - PyLong_FromUnsignedLong(IO_REPARSE_TAG_APPEXECLINK)) < 0) { - return -1; + if (_PyModule_Add(module, "IO_REPARSE_TAG_APPEXECLINK", + PyLong_FromUnsignedLong(IO_REPARSE_TAG_APPEXECLINK)) < 0) { + return -1; } #endif |