From 221ee4c28888ff16ac68433c64cd2cee4fa8f14c Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 9 Dec 2023 18:56:25 +0100 Subject: [PATCH] Python bindings: add missing reference increment on Py_None in error case of Geometry.GetPoints() (fixes #8945) --- swig/include/python/typemaps_python.i | 1 + 1 file changed, 1 insertion(+) diff --git a/swig/include/python/typemaps_python.i b/swig/include/python/typemaps_python.i index 626f6e55b2ba..9b7dce64e753 100644 --- a/swig/include/python/typemaps_python.i +++ b/swig/include/python/typemaps_python.i @@ -2331,6 +2331,7 @@ DecomposeSequenceOf4DCoordinates( PyObject *seq, int nCount, double *x, double * int nPointCount = *($1); if (nPointCount == 0) { + Py_INCREF(Py_None); $result = Py_None; } else