From 93bec723efedd8d6c44bcfe9b63ce65d844fb3da Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 13 Dec 2010 22:09:26 +0100 Subject: [PATCH] fix reference leak in error case --- Cython/Compiler/Nodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index ca893e57..ce96a3ba 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2752,6 +2752,8 @@ class DefNode(FuncDefNode): code.putln("if (unlikely(!%s)) {" % self.star_arg.entry.cname) if self.starstar_arg: code.put_decref(self.starstar_arg.entry.cname, py_object_type) + if self.needs_closure: + code.put_decref(Naming.cur_scope_cname, self.local_scope.scope_class.type) code.put_finish_refcount_context() code.putln('return %s;' % self.error_value()) code.putln('}') -- 2.26.2