From f62ca61fbdd1d88357b1b2e007c5c071a457d52a Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 9 Apr 2009 23:05:40 -0700 Subject: [PATCH] Ticket #270, CEnumDefNode leaks memory during construction --- Cython/Compiler/Nodes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index a51027c6..eadcab11 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -916,12 +916,13 @@ class CEnumDefNode(StatNode): self.temp, item.cname, code.error_goto_if_null(self.temp, item.pos))) + code.put_gotref(self.temp) code.putln('if (__Pyx_SetAttrString(%s, "%s", %s) < 0) %s' % ( Naming.module_cname, item.name, self.temp, code.error_goto(item.pos))) - code.putln("%s = 0;" % self.temp) + code.put_decref_clear(self.temp, PyrexTypes.py_object_type) class CEnumDefItemNode(StatNode): -- 2.26.2