summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2008-04-01 08:08:09 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2008-04-01 08:08:09 (GMT)
commit36e6310e39c23a8082e270a809e3f0851910eec5 (patch)
tree886bd7855263284dffe1d6307e1b82ac5398740f /Python/compile.c
parentf7276c9b0e06a920ae917441b2f3d2e113d89612 (diff)
downloadcpython-36e6310e39c23a8082e270a809e3f0851910eec5.zip
cpython-36e6310e39c23a8082e270a809e3f0851910eec5.tar.gz
cpython-36e6310e39c23a8082e270a809e3f0851910eec5.tar.bz2
Fix refleak with nested classes. Fix originally by Amaury in r62015.
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 9ce8ac3..94a2715 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1551,6 +1551,7 @@ compiler_class(struct compiler *c, stmt_ty s)
{
/* use the class name for name mangling */
Py_INCREF(s->v.ClassDef.name);
+ Py_XDECREF(c->u->u_private);
c->u->u_private = s->v.ClassDef.name;
/* force it to have one mandatory argument */
c->u->u_argcount = 1;