Commit 1c249fcf authored by Alvaro Herrera's avatar Alvaro Herrera

Fix PL/Python memory leak involving array slices

Report and patch from Daniel Popowich, bug #5842
(with some debugging help from Alex Hunsaker)
parent 8c0a5eb7
......@@ -3201,14 +3201,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment