bpo-29655: Fixed possible reference leaks in import *. (#301) (#349)

Patch by Matthias Bussonnier.

(cherry picked from commit 160edb4357)
This commit is contained in:
Berker Peksag 2017-02-27 21:25:29 +03:00 committed by GitHub
parent bc144f0abf
commit 0dadf56737

View file

@ -2832,13 +2832,16 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
TARGET(IMPORT_STAR) {
PyObject *from = POP(), *locals;
int err;
if (PyFrame_FastToLocalsWithError(f) < 0)
if (PyFrame_FastToLocalsWithError(f) < 0) {
Py_DECREF(from);
goto error;
}
locals = f->f_locals;
if (locals == NULL) {
PyErr_SetString(PyExc_SystemError,
"no locals found during 'import *'");
Py_DECREF(from);
goto error;
}
READ_TIMESTAMP(intr0);