]> granicus.if.org Git - python/commitdiff
fix leak
authorJeremy Hylton <jeremy@alum.mit.edu>
Wed, 3 Jan 2001 22:32:16 +0000 (22:32 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Wed, 3 Jan 2001 22:32:16 +0000 (22:32 +0000)
Objects/listobject.c

index e5073e1ed5bc322fa36d07e90f269816fff759f4..59b1912a803edef1cdd663f4cbff3079edb55c9e 100644 (file)
@@ -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