Commit 7bf9a4ea authored by Christian Heimes's avatar Christian Heimes

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

CID 486649
parent f6e7dfa6
...@@ -553,7 +553,10 @@ _PyImport_FindExtensionObject(PyObject *name, PyObject *filename) ...@@ -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) {
......
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