diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-05-17 05:52:40 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-05-17 05:52:40 (GMT) |
commit | ad887cf7d1257e73819fa9fd926f15849192888c (patch) | |
tree | c1d7504cae6e7bf8cd29a5320ba53bec03e9a084 /Python/ceval.c | |
parent | 0495fa81e686ebfa40982e8a9298c3d50752cc58 (diff) | |
download | cpython-ad887cf7d1257e73819fa9fd926f15849192888c.zip cpython-ad887cf7d1257e73819fa9fd926f15849192888c.tar.gz cpython-ad887cf7d1257e73819fa9fd926f15849192888c.tar.bz2 |
fix possible refleak in MAKE_FUNCTION (closes #26991)
Patch by Xiang Zhang.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index ee79c21..3758b09 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3284,6 +3284,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) PyObject *anns = PyDict_New(); if (anns == NULL) { Py_DECREF(func); + Py_DECREF(names); goto error; } name_ix = PyTuple_Size(names); @@ -3299,9 +3300,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) if (err != 0) { Py_DECREF(anns); Py_DECREF(func); + Py_DECREF(names); goto error; } } + Py_DECREF(names); if (PyFunction_SetAnnotations(func, anns) != 0) { /* Can't happen unless @@ -3311,7 +3314,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) goto error; } Py_DECREF(anns); - Py_DECREF(names); } /* XXX Maybe this should be a separate opcode? */ |