Skip to content

Commit 38e5124

Browse files
committed
Fix PL/Python memory leak involving array slices
Report and patch from Daniel Popowich, bug #5842 (with some debugging help from Alex Hunsaker)
1 parent 7ae983d commit 38e5124

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/pl/plpython/plpython.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2772,14 +2772,9 @@ PLy_result_ass_item(PyObject *arg, Py_ssize_t idx, PyObject *item)
27722772
static PyObject *
27732773
PLy_result_slice(PyObject *arg, Py_ssize_t lidx, Py_ssize_t hidx)
27742774
{
2775-
PyObject *rv;
27762775
PLyResultObject *ob = (PLyResultObject *) arg;
27772776

2778-
rv = PyList_GetSlice(ob->rows, lidx, hidx);
2779-
if (rv == NULL)
2780-
return NULL;
2781-
Py_INCREF(rv);
2782-
return rv;
2777+
return PyList_GetSlice(ob->rows, lidx, hidx);
27832778
}
27842779

27852780
static int

0 commit comments

Comments
 (0)