From: Tim Peters Date: Sat, 5 May 2001 04:10:25 +0000 (+0000) Subject: Fix a tiny and unlikely memory leak. Was there before too, and actually X-Git-Tag: v2.2a3~1907 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12d0a6c78a376e8eddca3d3fa88ed3627aad795c;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Objects/abstract.c b/Objects/abstract.c index 2fe6b1f8391d..30e6191c6ab8 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); }