fix reference leak in error case
authorStefan Behnel <scoder@users.berlios.de>
Mon, 13 Dec 2010 21:09:26 +0000 (22:09 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Mon, 13 Dec 2010 21:09:26 +0000 (22:09 +0100)
Cython/Compiler/Nodes.py

index ca893e57ec7f93dce18a376a6702e9fead783dce..ce96a3ba51d4bfecfe1e5c4a3a012161d6fbb8d9 100644 (file)
@@ -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('}')