summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-03-28 20:30:50 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-03-28 20:30:50 (GMT)
commit69b747b7358780c84d1cac1317bfb7d5baa4e6e3 (patch)
tree676314dd91dd7a5ec16f678d30d1643097c1b253 /Python/compile.c
parentaa5fbdd71a6dff5685b7b3b93a8162fcd83e8804 (diff)
downloadcpython-69b747b7358780c84d1cac1317bfb7d5baa4e6e3.zip
cpython-69b747b7358780c84d1cac1317bfb7d5baa4e6e3.tar.gz
cpython-69b747b7358780c84d1cac1317bfb7d5baa4e6e3.tar.bz2
Fix a reference leak found by Georg, when compiling a class nested in another class.
Now "regrtest.py -R:: test_compile" is satisfied. Will backport.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 4f55b36..ae1f0da 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1431,6 +1431,7 @@ compiler_class(struct compiler *c, stmt_ty s)
if (!compiler_enter_scope(c, s->v.ClassDef.name, (void *)s,
s->lineno))
return 0;
+ Py_XDECREF(c->u->u_private);
c->u->u_private = s->v.ClassDef.name;
Py_INCREF(c->u->u_private);
str = PyString_InternFromString("__name__");