projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d5a8804
)
Fixed possible reference leak to mod when type_name() returns NULL
author
Christian Heimes
<christian@cheimes.de>
Mon, 10 Sep 2012 01:00:14 +0000
(
03:00
+0200)
committer
Christian Heimes
<christian@cheimes.de>
Mon, 10 Sep 2012 01:00:14 +0000
(
03:00
+0200)
Objects/typeobject.c
patch
|
blob
|
history
diff --git
a/Objects/typeobject.c
b/Objects/typeobject.c
index 1bda375c3d26112fa7fd0e23264b1e563ef1d9ff..e34b10ce40a0aacc7237e9730e410511f34686fb 100644
(file)
--- a/
Objects/typeobject.c
+++ b/
Objects/typeobject.c
@@
-647,8
+647,10
@@
type_repr(PyTypeObject *type)
mod = NULL;
}
name = type_name(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);