mirror of
https://github.com/python/cpython.git
synced 2025-09-18 14:40:43 +00:00
bpo-35454: Fix miscellaneous minor issues in error handling. (#11077)
* bpo-35454: Fix miscellaneous minor issues in error handling. * Fix a null pointer dereference.
This commit is contained in:
parent
bb86bf4c4e
commit
8905fcc85a
9 changed files with 44 additions and 23 deletions
|
@ -2143,10 +2143,10 @@ _imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file)
|
|||
}
|
||||
|
||||
mod = _PyImport_FindExtensionObject(name, path);
|
||||
if (mod != NULL) {
|
||||
if (mod != NULL || PyErr_Occurred()) {
|
||||
Py_DECREF(name);
|
||||
Py_DECREF(path);
|
||||
Py_INCREF(mod);
|
||||
Py_XINCREF(mod);
|
||||
return mod;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue