diff --git a/Objects/abstract.c b/Objects/abstract.c index 2fe6b1f8391..30e6191c6ab 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1220,8 +1220,10 @@ PySequence_Tuple(PyObject *v) n += 10; else n += 100; - if (_PyTuple_Resize(&result, n, 0) != 0) + if (_PyTuple_Resize(&result, n, 0) != 0) { + Py_DECREF(item); goto Fail; + } } PyTuple_SET_ITEM(result, j, item); }