postgres.git / summary / log / commit / refs

commit    7135bc5d6665fb9cf9452b660c0f7c3daa4a439b
Author:   Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:     Thu Mar 17 15:28:46 2011 +0000
First released in: 9.1.0, 8.2.21, 8.3.15, 8.4.8, 9.0.4

    Fix PL/Python memory leak involving array slices
    
    Report and patch from Daniel Popowich, bug #5842
    (with some debugging help from Alex Hunsaker)


src/pl/plpython/plpython.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 79203f1c0e0..d126d875e58 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -2328,14 +2328,9 @@ PLy_result_ass_item(PyObject *arg, Py_ssize_t idx, PyObject *item) static PyObject * PLy_result_slice(PyObject *arg, Py_ssize_t lidx, Py_ssize_t hidx) { - PyObject *rv; PLyResultObject *ob = (PLyResultObject *) arg; - rv = PyList_GetSlice(ob->rows, lidx, hidx); - if (rv == NULL) - return NULL; - Py_INCREF(rv); - return rv; + return PyList_GetSlice(ob->rows, lidx, hidx); } static int [parent: 08fc2d4f99b3]