Add missing check of PyDict_SetItem()'s return value in _PyImport_FindExtensionObject()
CID 486649
This commit is contained in:
parent
0bd447f847
commit
09ca794afe
|
@ -553,7 +553,10 @@ _PyImport_FindExtensionObject(PyObject *name, PyObject *filename)
|
|||
mod = def->m_base.m_init();
|
||||
if (mod == 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);
|
||||
}
|
||||
if (_PyState_AddModule(mod, def) < 0) {
|
||||
|
|
Loading…
Reference in New Issue