]> granicus.if.org Git - python/commitdiff
Issue #15291: Fix a memory leak where AST nodes where not properly deallocated.
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Jul 2012 10:43:32 +0000 (12:43 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Jul 2012 10:43:32 +0000 (12:43 +0200)
Misc/NEWS
Parser/asdl_c.py
Python/Python-ast.c

index 71fead59313a353e6a688c8f80316bed41f5fe1f..05139f2afc8caac16eb8e055207a074658089307 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.3.0 Beta 2?
 Core and Builtins
 -----------------
 
+- Issue #15291: Fix a memory leak where AST nodes where not properly
+  deallocated.
+
 - Issue #15110: Fix the tracebacks generated by "import xxx" to not show
   the importlib stack frames.
 
index 769f73f0cb753e3adf159fd54014ed310003c08e..e4165b09ad1dfb92634353e5b95ddc0606bfb628 100755 (executable)
@@ -612,6 +612,7 @@ static void
 ast_dealloc(AST_object *self)
 {
     Py_CLEAR(self->dict);
+    Py_TYPE(self)->tp_free(self);
 }
 
 static int
index 4ca269f9f542a9eecd5901f2519778e6e7cbd1c3..60147fa15b4a592567e3703f0bafd6d9fbabc355 100644 (file)
@@ -464,6 +464,7 @@ static void
 ast_dealloc(AST_object *self)
 {
     Py_CLEAR(self->dict);
+    Py_TYPE(self)->tp_free(self);
 }
 
 static int