]> granicus.if.org Git - python/commitdiff
bpo-29655: Fixed possible reference leaks in `import *`. (#301) (#510)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 8 Mar 2017 11:44:33 +0000 (13:44 +0200)
committerGitHub <noreply@github.com>
Wed, 8 Mar 2017 11:44:33 +0000 (13:44 +0200)
Original patch by Matthias Bussonnier.
(cherry picked from commit 160edb43571311a3785785c1dfa784afc52d87be)

Python/ceval.c

index 733f0776ecfbcc637593eb0bdc62b4f54901a951..09836519988ae61c3b7f4e77aada8f0b42f9d113 100644 (file)
@@ -2641,6 +2641,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
             if ((x = f->f_locals) == NULL) {
                 PyErr_SetString(PyExc_SystemError,
                     "no locals found during 'import *'");
+                Py_DECREF(v);
                 break;
             }
             READ_TIMESTAMP(intr0);