mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Add missing check of PyDict_SetItem()'s return value in _PyImport_FindExtensionObject()
CID 486649
This commit is contained in:
parent
0bd447f847
commit
09ca794afe
1 changed files with 4 additions and 1 deletions
|
@ -553,7 +553,10 @@ _PyImport_FindExtensionObject(PyObject *name, PyObject *filename)
|
||||||
mod = def->m_base.m_init();
|
mod = def->m_base.m_init();
|
||||||
if (mod == NULL)
|
if (mod == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
PyDict_SetItem(PyImport_GetModuleDict(), name, mod);
|
if (PyDict_SetItem(PyImport_GetModuleDict(), name, mod) == -1) {
|
||||||
|
Py_DECREF(mod);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
Py_DECREF(mod);
|
Py_DECREF(mod);
|
||||||
}
|
}
|
||||||
if (_PyState_AddModule(mod, def) < 0) {
|
if (_PyState_AddModule(mod, def) < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue