1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-05 09:19:17 +03:00

Fix PL/Python memory leak involving array slices

Report and patch from Daniel Popowich, bug #5842
(with some debugging help from Alex Hunsaker)
This commit is contained in:
Alvaro Herrera 2011-03-17 12:28:46 -03:00
parent 8c0a5eb78a
commit 1c249fcfcc

View File

@ -3201,14 +3201,9 @@ PLy_result_ass_item(PyObject *arg, Py_ssize_t idx, PyObject *item)
static PyObject * static PyObject *
PLy_result_slice(PyObject *arg, Py_ssize_t lidx, Py_ssize_t hidx) PLy_result_slice(PyObject *arg, Py_ssize_t lidx, Py_ssize_t hidx)
{ {
PyObject *rv;
PLyResultObject *ob = (PLyResultObject *) arg; PLyResultObject *ob = (PLyResultObject *) arg;
rv = PyList_GetSlice(ob->rows, lidx, hidx); return PyList_GetSlice(ob->rows, lidx, hidx);
if (rv == NULL)
return NULL;
Py_INCREF(rv);
return rv;
} }
static int static int