Skip to content

Commit 196e16d

Browse files
authored
gh-154275: Fix cleanup code in _Py_make_parameters (#154341)
1 parent 027a833 commit 196e16d

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)