diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-07-18 07:50:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-18 07:50:47 (GMT) |
commit | 3e65baee72131b49f4ce8ca2da568a6f2001ce93 (patch) | |
tree | 372b75670036916d6826f901e0f7c2e586b2bb4f /Modules/_stat.c | |
parent | 83ac1284909433f3f77c0a4f459996b1ba3f1a4d (diff) | |
download | cpython-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.c | 18 |
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 |