summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-05-05 04:10:25 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-05-05 04:10:25 (GMT)
commit12d0a6c78a376e8eddca3d3fa88ed3627aad795c (patch)
tree82aacbf2564026b30e100edf76103dbc0651a965 /Objects/abstract.c
parent6912d4ddf0504a3d5611ddd12cbde3354bd48279 (diff)
downloadcpython-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.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c4
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);
}