Kaydet (Commit) 7accf203 authored tarafından Berker Peksag's avatar Berker Peksag Kaydeden (comit) GitHub

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

Patch by Matthias Bussonnier.

(cherry picked from commit 160edb43)
üst bb59d89c
......@@ -2857,13 +2857,16 @@ _PyEval_EvalFrameDefault(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;
}
err = import_all_from(locals, from);
......
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