]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Minor memory leak.
authorArmin Rigo <arigo@tunes.org>
Thu, 29 Jul 2004 10:56:55 +0000 (10:56 +0000)
committerArmin Rigo <arigo@tunes.org>
Thu, 29 Jul 2004 10:56:55 +0000 (10:56 +0000)
Objects/listobject.c

index e9f37b3493b2a68b14924665113d82a8f9f8bba5..ab8cc1f63269f4c20b188d2a50fb5b44f3958429 100644 (file)
@@ -536,6 +536,7 @@ list_ass_slice(PyListObject *a, int ilow, int ihigh, PyObject *v)
                p = recycle = PyMem_NEW(PyObject *, (ihigh-ilow));
                if (recycle == NULL) {
                        PyErr_NoMemory();
+                       Py_XDECREF(v_as_SF);
                        return -1;
                }
        }
@@ -556,6 +557,7 @@ list_ass_slice(PyListObject *a, int ilow, int ihigh, PyObject *v)
                if (list_resize(a, s+d) == -1) {
                        if (recycle != NULL)
                                PyMem_DEL(recycle);
+                       Py_XDECREF(v_as_SF);
                        return -1;
                }
                item = a->ob_item;