postgres.git / summary / log / commit / refs
commit 051096d06ece0c553e8ed85bfe45129f488a806d
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Mon Jan 17 16:01:04 2011 +0000
First released in: 9.1.0, 9.0.3
Increment Py_None refcount for NULL array elements
Per bug #5835 by Julien Demoor
Author: Alex Hunsaker
src/pl/plpython/plpython.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index ea47067a855..1d5687fba47 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -2042,7 +2042,10 @@ PLyList_FromArray(PLyDatumToOb *arg, Datum d)
elm->typlen, elm->typbyval, elm->typalign,
&isnull);
if (isnull)
+ {
+ Py_INCREF(Py_None);
PyList_SET_ITEM(list, i, Py_None);
+ }
else
PyList_SET_ITEM(list, i, elm->func(elm, elem));
}
[parent: 1435a8554cd5]