diff options
| author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2011-03-17 12:28:46 -0300 |
|---|---|---|
| committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2011-03-17 12:32:46 -0300 |
| commit | 38e5124574ae86bf8992c17c176958b0ec4d6ee0 (patch) | |
| tree | cda65c905772e261736f8ea91be4b3feb5b131e9 | |
| parent | 7ae983d94dfe6479980e24aa179d1561ad5a3655 (diff) | |
Fix PL/Python memory leak involving array slices
Report and patch from Daniel Popowich, bug #5842
(with some debugging help from Alex Hunsaker)
| -rw-r--r-- | src/pl/plpython/plpython.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 1d5687fba47..54af7f2a67c 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -2772,14 +2772,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 |
