diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-05-05 04:10:25 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-05-05 04:10:25 (GMT) |
commit | 12d0a6c78a376e8eddca3d3fa88ed3627aad795c (patch) | |
tree | 82aacbf2564026b30e100edf76103dbc0651a965 | |
parent | 6912d4ddf0504a3d5611ddd12cbde3354bd48279 (diff) | |
download | cpython-12d0a6c78a376e8eddca3d3fa88ed3627aad795c.zip cpython-12d0a6c78a376e8eddca3d3fa88ed3627aad795c.tar.gz cpython-12d0a6c78a376e8eddca3d3fa88ed3627aad795c.tar.bz2 |
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.
-rw-r--r-- | Objects/abstract.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 2fe6b1f..30e6191 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); } |