aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2011-01-17 13:01:04 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2011-01-17 13:01:04 -0300
commit051096d06ece0c553e8ed85bfe45129f488a806d (patch)
tree892e0e9b03e9d472ff1622ffdd1ffc42932fb96d
parent1435a8554cd514d668a46c4f6b1e4a1e3bd30fd5 (diff)
downloadpostgresql-051096d06ece0c553e8ed85bfe45129f488a806d.tar.gz
postgresql-051096d06ece0c553e8ed85bfe45129f488a806d.zip
Increment Py_None refcount for NULL array elements
Per bug #5835 by Julien Demoor Author: Alex Hunsaker
-rw-r--r--src/pl/plpython/plpython.c3
1 files changed, 3 insertions, 0 deletions
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));
}