From e74368f39425432af36c3e5c340bb5e8fccddf3d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 1 Sep 2008 13:30:13 +0200 Subject: [PATCH] missing DECREF in WriteUnraisable --- Cython/Compiler/Nodes.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index def2e025..890c658b 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -4579,9 +4579,12 @@ static void __Pyx_WriteUnraisable(const char *name) { ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) - ctx = Py_None; - PyErr_WriteUnraisable(ctx); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } } """] -- 2.26.2