From 133b92679ab23e0fa4a6f3b6e45f493312531024 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Mon, 13 Jun 2022 20:20:06 +0200 Subject: [PATCH] BUG: fix small refcount issue in `ndimage._ctest` Note that this is only test code, so it wasn't a real-world problem. Closes gh-16236 Reference: https://github.com/scipy/scipy/pull/16397/commits/133b92679ab23e0fa4a6f3b6e45f493312531024 Conflict: NA --- scipy/ndimage/src/_ctest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scipy/ndimage/src/_ctest.c b/scipy/ndimage/src/_ctest.c index fe8ce676e..f84ba064a 100644 --- a/scipy/ndimage/src/_ctest.c +++ b/scipy/ndimage/src/_ctest.c @@ -93,6 +93,8 @@ py_filter2d(PyObject *obj, PyObject *args) goto error; } callback_data[i] = PyFloat_AsDouble(item); + Py_DECREF(item); + item = NULL; if (PyErr_Occurred()) goto error; } -- 2.33.0