Skip to content

Commit e1eb9e8

Browse files
[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 196e16d) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent 40657ad commit e1eb9e8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Objects/genericaliasobject.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,14 @@ _Py_make_parameters(PyObject *args)
195195
if (is_args_list) {
196196
args = tuple_args = PySequence_Tuple(args);
197197
if (args == NULL) {
198-
return NULL;
198+
goto cleanup;
199199
}
200200
}
201201
Py_ssize_t nargs = PyTuple_GET_SIZE(args);
202202
Py_ssize_t len = nargs;
203203
PyObject *parameters = PyTuple_New(len);
204204
if (parameters == NULL) {
205-
Py_XDECREF(tuple_args);
206-
return NULL;
205+
goto error;
207206
}
208207
Py_ssize_t iparam = 0;
209208
for (Py_ssize_t iarg = 0; iarg < nargs; iarg++) {

0 commit comments

Comments
 (0)