diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-07-20 11:51:45 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-07-20 11:51:45 (GMT) |
commit | ddcb6206bf7feebb0a1671e475ee877f683af145 (patch) | |
tree | 30ff6289a6ee7163ac4990175ae967a1a8fe3fc8 /Objects/classobject.c | |
parent | 3be7a8bbcfb82d54865b1bf3d775d40a66c8620f (diff) | |
download | cpython-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.c | 4 |
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)) { |