summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2008-04-01 08:08:09 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2008-04-01 08:08:09 +0000
commit2968566c86d8ddd0bc5865efc738b3216cdff92d (patch)
treeb19febe54695a83d30334af17b41253411d9e18c /Python/compile.c
parent4bf6b41fbb4ac38d58cc02a50d3f5a5d24ea5b0b (diff)
downloadcpython-2968566c86d8ddd0bc5865efc738b3216cdff92d.tar.gz
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 9ce8ac334f..94a2715443 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;