summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-07-20 11:51:45 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-07-20 11:51:45 (GMT)
commitddcb6206bf7feebb0a1671e475ee877f683af145 (patch)
tree30ff6289a6ee7163ac4990175ae967a1a8fe3fc8 /Objects/classobject.c
parent3be7a8bbcfb82d54865b1bf3d775d40a66c8620f (diff)
downloadcpython-ddcb6206bf7feebb0a1671e475ee877f683af145.zip
cpython-ddcb6206bf7feebb0a1671e475ee877f683af145.tar.gz
cpython-ddcb6206bf7feebb0a1671e475ee877f683af145.tar.bz2
Issue #15404: Refleak in PyMethodObject repr.
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 6df930f..b7d35ef 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -243,8 +243,10 @@ method_repr(PyMethodObject *a)
else {
klassname = PyObject_GetAttrString(klass, "__name__");
if (klassname == NULL) {
- if (!PyErr_ExceptionMatches(PyExc_AttributeError))
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ Py_XDECREF(funcname);
return NULL;
+ }
PyErr_Clear();
}
else if (!PyUnicode_Check(klassname)) {