Skip to content

Commit 051096d

Browse files
committed
Increment Py_None refcount for NULL array elements
Per bug #5835 by Julien Demoor Author: Alex Hunsaker
1 parent 1435a85 commit 051096d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/pl/plpython/plpython.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,10 @@ PLyList_FromArray(PLyDatumToOb *arg, Datum d)
20422042
elm->typlen, elm->typbyval, elm->typalign,
20432043
&isnull);
20442044
if (isnull)
2045+
{
2046+
Py_INCREF(Py_None);
20452047
PyList_SET_ITEM(list, i, Py_None);
2048+
}
20462049
else
20472050
PyList_SET_ITEM(list, i, elm->func(elm, elem));
20482051
}

0 commit comments

Comments
 (0)