mirror of https://github.com/python/cpython
gh-102251: Fix reference leak in _testsinglephase initialization (#105082)
Correctly decref 'initialized' in init_module() Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
parent
219f01b185
commit
d14eb3433c
|
@ -140,7 +140,9 @@ init_module(PyObject *module, module_state *state)
|
|||
if (initialized == NULL) {
|
||||
return -1;
|
||||
}
|
||||
if (PyModule_AddObjectRef(module, "_module_initialized", initialized) != 0) {
|
||||
int rc = PyModule_AddObjectRef(module, "_module_initialized", initialized);
|
||||
Py_DECREF(initialized);
|
||||
if (rc < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue