File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ Release date: tba
1010Core and Builtins
1111-----------------
1212
13+ - Issue #26991: Fix possible refleak when creating a function with annotations.
14+
1315- Issue #27039: Fixed bytearray.remove() for values greater than 127. Patch by
1416 Joe Jevnik.
1517
Original file line number Diff line number Diff line change @@ -3284,6 +3284,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
32843284 PyObject * anns = PyDict_New ();
32853285 if (anns == NULL ) {
32863286 Py_DECREF (func );
3287+ Py_DECREF (names );
32873288 goto error ;
32883289 }
32893290 name_ix = PyTuple_Size (names );
@@ -3299,9 +3300,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
32993300 if (err != 0 ) {
33003301 Py_DECREF (anns );
33013302 Py_DECREF (func );
3303+ Py_DECREF (names );
33023304 goto error ;
33033305 }
33043306 }
3307+ Py_DECREF (names );
33053308
33063309 if (PyFunction_SetAnnotations (func , anns ) != 0 ) {
33073310 /* Can't happen unless
@@ -3311,7 +3314,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
33113314 goto error ;
33123315 }
33133316 Py_DECREF (anns );
3314- Py_DECREF (names );
33153317 }
33163318
33173319 /* XXX Maybe this should be a separate opcode? */
You can’t perform that action at this time.
0 commit comments