]> granicus.if.org Git - python/commitdiff
Issue #24377: Fix a ref leak in OrderedDict.__repr__.
authorEric Snow <ericsnowcurrently@gmail.com>
Wed, 3 Jun 2015 17:09:48 +0000 (11:09 -0600)
committerEric Snow <ericsnowcurrently@gmail.com>
Wed, 3 Jun 2015 17:09:48 +0000 (11:09 -0600)
Misc/NEWS
Objects/odictobject.c

index de915a1c915c89489ba494ee35647a792f6d8939..c4bfa701e5e5389b81d674375f76a2f8ce7041f9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -25,6 +25,8 @@ Library
 
 - Issue #24362: Simplify the C OrderedDict fast nodes resize logic.
 
+- Issue #24377: Fix a ref leak in OrderedDict.__repr__.
+
 
 What's New in Python 3.5.0 beta 2?
 ==================================
index 79ac82620718a4ff9fa96019798ac70d9f905c46..55055ac0999853072abbf731311e22ecd5d64743 100644 (file)
@@ -1578,7 +1578,7 @@ odict_repr(PyODictObject *self)
             if (value == NULL) {
                 if (!PyErr_Occurred())
                     PyErr_SetObject(PyExc_KeyError, key);
-                return NULL;
+                goto Done;
             }
             pair = PyTuple_Pack(2, key, value);
             if (pair == NULL)