Commit 74ba26a4 authored by Christian Heimes's avatar Christian Heimes

Add missing check of PyDict_SetItem()'s return value in _PyImport_FindExtensionObject()

CID 486649
parents 895bdfb1 09ca794a
......@@ -585,7 +585,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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment