diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-11 08:38:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-11 08:38:03 +0200 |
commit | 8905fcc85a6fc3ac394bc89b0bbf40897e9497a6 (patch) | |
tree | 5b7afcdceab6dae37e3db90f952c5c76fe46b5cf /Python/pylifecycle.c | |
parent | bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d (diff) | |
download | cpython-git-8905fcc85a6fc3ac394bc89b0bbf40897e9497a6.tar.gz |
bpo-35454: Fix miscellaneous minor issues in error handling. (#11077)
* bpo-35454: Fix miscellaneous minor issues in error handling.
* Fix a null pointer dereference.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 6de32decc5..37ecc510c8 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1286,6 +1286,9 @@ new_interpreter(PyThreadState **tstate_p) PyDict_SetItemString(interp->sysdict, "modules", modules); _PySys_EndInit(interp->sysdict, interp); } + else if (PyErr_Occurred()) { + goto handle_error; + } bimod = _PyImport_FindBuiltin("builtins", modules); if (bimod != NULL) { @@ -1294,6 +1297,9 @@ new_interpreter(PyThreadState **tstate_p) goto handle_error; Py_INCREF(interp->builtins); } + else if (PyErr_Occurred()) { + goto handle_error; + } /* initialize builtin exceptions */ _PyExc_Init(bimod); |