From: Stefan Behnel Date: Mon, 13 Dec 2010 21:09:26 +0000 (+0100) Subject: fix reference leak in error case X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=93bec723efedd8d6c44bcfe9b63ce65d844fb3da;p=cython.git fix reference leak in error case --- 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('}')