[Python-checkins] cpython (merge 3.2 -> default): Merge 3.2

andrew.svetlov python-checkins at python.org
Fri Jul 20 13:57:57 CEST 2012


http://hg.python.org/cpython/rev/dc75d5b4bb9c
changeset:   78192:dc75d5b4bb9c
parent:      78189:4b5e8f7d1ac4
parent:      78191:4b724884c81f
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Fri Jul 20 14:52:54 2012 +0300
summary:
  Merge 3.2

files:
  Misc/NEWS             |  2 ++
  Objects/classobject.c |  4 +++-
  2 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@
 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
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -244,8 +244,10 @@
     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)) {

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list