[Python-checkins] commit of r41606 - python/branches/ast-arena/Python/compile.c

brett.cannon python-checkins at python.org
Mon Dec 5 07:02:05 CET 2005


Author: brett.cannon
Date: Mon Dec  5 07:02:00 2005
New Revision: 41606

Modified:
   python/branches/ast-arena/Python/compile.c
Log:
Fix a missed freeing of an arena on an error case.

Might be a bad fix since some tests failed, but they didn't not seem to occur
from memory issues.


Modified: python/branches/ast-arena/Python/compile.c
==============================================================================
--- python/branches/ast-arena/Python/compile.c	(original)
+++ python/branches/ast-arena/Python/compile.c	Mon Dec  5 07:02:00 2005
@@ -296,13 +296,12 @@
 PyCodeObject *
 PyNode_Compile(struct _node *n, const char *filename)
 {
-	PyCodeObject *co;
+	PyCodeObject *co = NULL;
         PyArena *arena;
         arena = PyArena_New();
 	mod_ty mod = PyAST_FromNode(n, NULL, filename, arena);
-	if (!mod)
-		return NULL;
-	co = PyAST_Compile(mod, filename, NULL, arena);
+	if (mod)
+		co = PyAST_Compile(mod, filename, NULL, arena);
         PyArena_Free(arena);
 	return co;
 }


More information about the Python-checkins mailing list