From cf0eff7075d21ccfa985676eb3a5e30f8694fc4c Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 27 Jan 2016 09:48:25 +0100 Subject: Decrement refcount of CallMethod return value --- python/astra/src/PythonPluginAlgorithm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/astra/src/PythonPluginAlgorithm.cpp b/python/astra/src/PythonPluginAlgorithm.cpp index 0100bed..61a56ea 100644 --- a/python/astra/src/PythonPluginAlgorithm.cpp +++ b/python/astra/src/PythonPluginAlgorithm.cpp @@ -144,7 +144,10 @@ void fixLapackLoading(){ if(lapack!=NULL){ Py_DECREF(lapack); } - PyObject_CallMethod(sys, "setdlopenflags", "O",curFlags); + PyObject *retVal2 = PyObject_CallMethod(sys, "setdlopenflags", "O",curFlags); + if(retVal2!=NULL){ + Py_DECREF(retVal2); + } Py_DECREF(retVal); } Py_DECREF(curFlags); -- cgit v1.2.3