From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 21 Jul 2026 10:53:06 +0000 (+0200) Subject: [3.14] gh-154275: Fix cleanup code in `_Py_make_parameters` (GH-154341) (#154343) X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=e1eb9e882edf65341689ca4cfca7f31c4038d03d;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-154275: Fix cleanup code in `_Py_make_parameters` (GH-154341) (#154343) gh-154275: Fix cleanup code in `_Py_make_parameters` (GH-154341) (cherry picked from commit 196e16d54f9f06f566c52e7bca3b5213a8a64223) Co-authored-by: sobolevn --- diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index ea3ad683f53f..010707cd0ef7 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -195,15 +195,14 @@ _Py_make_parameters(PyObject *args) if (is_args_list) { args = tuple_args = PySequence_Tuple(args); if (args == NULL) { - return NULL; + goto cleanup; } } Py_ssize_t nargs = PyTuple_GET_SIZE(args); Py_ssize_t len = nargs; PyObject *parameters = PyTuple_New(len); if (parameters == NULL) { - Py_XDECREF(tuple_args); - return NULL; + goto error; } Py_ssize_t iparam = 0; for (Py_ssize_t iarg = 0; iarg < nargs; iarg++) {