From db60bb5aad6c0a2364e043e97e03e32083cd1999 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Wed, 3 Jan 2001 22:32:16 +0000 Subject: [PATCH] fix leak --- Objects/listobject.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Objects/listobject.c b/Objects/listobject.c index e5073e1ed5b..59b1912a803 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