summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-03-28 20:45:42 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-03-28 20:45:42 +0000
commit8432d86b9f7a6295718544dd5e7c93fd9e3f94e7 (patch)
treea78ec5d71fa1ccf156812b8bbc5bff84ee79af99 /Python
parent198e353735be424ee7e21381504a6ab13d2f5fa7 (diff)
downloadcpython-git-8432d86b9f7a6295718544dd5e7c93fd9e3f94e7.tar.gz
Fix a reference leak found by Georg, when compiling a class nested in another class.
Test is run with "regrtest.py -R:: test_compile" Backport of r62015
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index f40c325bbf..d40357c429 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2061,6 +2061,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__");