summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 01:01:16 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-10 01:01:16 (GMT)
commit455657961e78d0019bb789ccd0b5f5a94a262e18 (patch)
tree641fddb4b09427e8d55abc53b03c0c9796b6b6b6 /Objects
parentc4fe3fed6eddb3cefa917a8dcf86fff0b04df6ee (diff)
parenta0e7e41cba6c75f493a64ce09037cecb60642190 (diff)
downloadcpython-455657961e78d0019bb789ccd0b5f5a94a262e18.zip
cpython-455657961e78d0019bb789ccd0b5f5a94a262e18.tar.gz
cpython-455657961e78d0019bb789ccd0b5f5a94a262e18.tar.bz2
Fixed possible reference leak to mod when type_name() returns NULL
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index bd55ede..f51700e 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -691,8 +691,10 @@ type_repr(PyTypeObject *type)
mod = NULL;
}
name = type_qualname(type, NULL);
- if (name == NULL)
+ if (name == NULL) {
+ Py_XDECREF(mod);
return NULL;
+ }
if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins"))
rtn = PyUnicode_FromFormat("<class '%U.%U'>", mod, name);