summaryrefslogtreecommitdiffstats
path: root/Modules/_threadmodule.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/_threadmodule.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/_threadmodule.c')
-rw-r--r--Modules/_threadmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 8239330..d8a797f 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -1671,8 +1671,8 @@ thread_module_exec(PyObject *module)
// Round towards minus infinity
timeout_max = floor(timeout_max);
- if (PyModule_AddObject(module, "TIMEOUT_MAX",
- PyFloat_FromDouble(timeout_max)) < 0) {
+ if (PyModule_Add(module, "TIMEOUT_MAX",
+ PyFloat_FromDouble(timeout_max)) < 0) {
return -1;
}