mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
gh-86493: Fix possible leaks in some modules initialization (GH-106768)
Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time.
This commit is contained in:
parent
83ac128490
commit
3e65baee72
8 changed files with 37 additions and 45 deletions
|
|
@ -1511,13 +1511,13 @@ static PyMethodDef module_functions[] = {
|
|||
static int
|
||||
module_exec(PyObject *module)
|
||||
{
|
||||
if (PyModule_AddObject(module, "SIZEOF_PYGC_HEAD",
|
||||
PyLong_FromSsize_t(sizeof(PyGC_Head))) < 0) {
|
||||
if (PyModule_Add(module, "SIZEOF_PYGC_HEAD",
|
||||
PyLong_FromSsize_t(sizeof(PyGC_Head))) < 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (PyModule_AddObject(module, "SIZEOF_TIME_T",
|
||||
PyLong_FromSsize_t(sizeof(time_t))) < 0) {
|
||||
if (PyModule_Add(module, "SIZEOF_TIME_T",
|
||||
PyLong_FromSsize_t(sizeof(time_t))) < 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue