git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ae983d)
Fix PL/Python memory leak involving array slices
2011年3月17日 15:28:46 +0000 (12:28 -0300)
2011年3月17日 15:32:46 +0000 (12:32 -0300)
Report and patch from Daniel Popowich, bug #5842
(with some debugging help from Alex Hunsaker)


diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 1d5687fba4723391ab8fa1012dca5f7f1aef37d7..54af7f2a67c83b308cab2992856341ab3ca20b6c 100644 (file)
--- 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
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /