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 15:26:15 -0300 |
commit | 1c249fcfcc331d589a2fa1574e16c0ef3d1547ce (patch) | |
tree | 51172562418e7629c100d5b39b74371e4af5ed5a /src/pl/plpython/plpython.c | |
parent | 8c0a5eb78af00ec4720e693feaba70b5a73205d1 (diff) | |
download | postgresql-1c249fcfcc331d589a2fa1574e16c0ef3d1547ce.tar.gz postgresql-1c249fcfcc331d589a2fa1574e16c0ef3d1547ce.zip |
Fix PL/Python memory leak involving array slices
Report and patch from Daniel Popowich, bug #5842
(with some debugging help from Alex Hunsaker)
Diffstat (limited to 'src/pl/plpython/plpython.c')
-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 1f8c27f632a..dd2b9190fca 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -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 |