Skip to content

Commit c9d5cac

Browse files
committed
Fix refleak in genericaliasobject.c
1 parent efb497b commit c9d5cac

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Objects/genericaliasobject.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ subs_tvars(PyObject *obj, PyObject *params,
299299
&PyTuple_GET_ITEM(arg, 0),
300300
PyTuple_GET_SIZE(arg));
301301
if (j < 0) {
302+
Py_DECREF(subparams);
303+
Py_DECREF(subargs);
302304
return NULL;
303305
}
304306
continue;
@@ -455,6 +457,7 @@ _Py_subs_parameters(PyObject *self, PyObject *args, PyObject *parameters, PyObje
455457
if (is_args_list) {
456458
args = tuple_args = PySequence_Tuple(args);
457459
if (args == NULL) {
460+
Py_DECREF(item);
458461
return NULL;
459462
}
460463
}

0 commit comments

Comments
 (0)