summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-01-03 22:32:16 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-01-03 22:32:16 (GMT)
commitdb60bb5aad6c0a2364e043e97e03e32083cd1999 (patch)
tree81e07cb160b88a4b365ac6c43622ccaa23b66ab3 /Objects/listobject.c
parenta866df806dd0ffd439bbba873ab9f3da7080e0a0 (diff)
downloadcpython-db60bb5aad6c0a2364e043e97e03e32083cd1999.zip
cpython-db60bb5aad6c0a2364e043e97e03e32083cd1999.tar.gz
cpython-db60bb5aad6c0a2364e043e97e03e32083cd1999.tar.bz2
fix leak
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index e5073e1..59b1912 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -596,9 +596,11 @@ listextend_internal(PyListObject *self, PyObject *b)
int blen;
register int i;
- if (PyObject_Size(b) == 0)
+ if (PyObject_Size(b) == 0) {
/* short circuit when b is empty */
+ Py_DECREF(b);
return 0;
+ }
if (self == (PyListObject*)b) {
/* as in list_ass_slice() we must special case the