summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-07-20 11:52:54 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-07-20 11:52:54 (GMT)
commita0364764fdaca63881dc78d8625e05d9880fc440 (patch)
treed13c4ea3329997b38354904cf90d09dc007dfa01
parent5e1658c5d7030d03148a4805ffb09d4374963580 (diff)
parentddcb6206bf7feebb0a1671e475ee877f683af145 (diff)
downloadcpython-a0364764fdaca63881dc78d8625e05d9880fc440.zip
cpython-a0364764fdaca63881dc78d8625e05d9880fc440.tar.gz
cpython-a0364764fdaca63881dc78d8625e05d9880fc440.tar.bz2
Merge 3.2
-rw-r--r--Misc/NEWS2
-rw-r--r--Objects/classobject.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 4758df7..31c9986 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@ What's New in Python 3.3.0 Beta 2?
Core and Builtins
-----------------
+- Issue #15404: Refleak in PyMethodObject repr.
+
- Issue #15394: An issue in PyModule_Create that caused references to
be leaked on some error paths has been fixed. Patch by Julia Lawall.
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 0416a6a..c481dd3 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -244,8 +244,10 @@ method_repr(PyMethodObject *a)
else {
klassname = _PyObject_GetAttrId(klass, &PyId___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)) {