mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Add missing check of PyDict_SetItem()'s return value in _PyImport_FindExtensionObject()
CID 486649
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user