From 12d0a6c78a376e8eddca3d3fa88ed3627aad795c Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sat, 5 May 2001 04:10:25 +0000 Subject: [PATCH] Fix a tiny and unlikely memory leak. Was there before too, and actually several of these turned up and got fixed during the iteration crusade. --- Objects/abstract.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Objects/abstract.c b/Objects/abstract.c index 2fe6b1f839..30e6191c6a 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); } -- 2.49.0