summaryrefslogtreecommitdiffstats
path: root/Modules/_stat.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-07-18 07:50:47 (GMT)
committerGitHub <noreply@github.com>2023-07-18 07:50:47 (GMT)
commit3e65baee72131b49f4ce8ca2da568a6f2001ce93 (patch)
tree372b75670036916d6826f901e0f7c2e586b2bb4f /Modules/_stat.c
parent83ac1284909433f3f77c0a4f459996b1ba3f1a4d (diff)
downloadcpython-3e65baee72131b49f4ce8ca2da568a6f2001ce93.zip
cpython-3e65baee72131b49f4ce8ca2da568a6f2001ce93.tar.gz
cpython-3e65baee72131b49f4ce8ca2da568a6f2001ce93.tar.bz2
gh-86493: Fix possible leaks in some modules initialization (GH-106768)
Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time.
Diffstat (limited to 'Modules/_stat.c')
-rw-r--r--Modules/_stat.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/_stat.c b/Modules/_stat.c
index 9747d84..6cea261 100644
--- a/Modules/_stat.c
+++ b/Modules/_stat.c
@@ -591,17 +591,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