diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2011-01-17 12:59:41 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2011-01-17 13:04:53 -0300 |
commit | 978445bece6ce3df55599ee971a4a5dc217bf34c (patch) | |
tree | 4b789db463bbfec84a273bc3cabcf2952bde9162 | |
parent | 08af45f4ff89ff5bee25c7d5bf496e987eb90060 (diff) | |
download | postgresql-978445bece6ce3df55599ee971a4a5dc217bf34c.tar.gz postgresql-978445bece6ce3df55599ee971a4a5dc217bf34c.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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 1ae12396a12..d3b48ae6752 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -2043,7 +2043,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)); } |