diff options
author | Christian Heimes <christian@cheimes.de> | 2012-09-10 01:01:16 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2012-09-10 01:01:16 (GMT) |
commit | 455657961e78d0019bb789ccd0b5f5a94a262e18 (patch) | |
tree | 641fddb4b09427e8d55abc53b03c0c9796b6b6b6 /Objects | |
parent | c4fe3fed6eddb3cefa917a8dcf86fff0b04df6ee (diff) | |
parent | a0e7e41cba6c75f493a64ce09037cecb60642190 (diff) | |
download | cpython-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.c | 4 |
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); |