From db4061cb9d3c2a369fa49a3820ffc11854119da3 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Wed, 3 Jun 2015 11:09:48 -0600 Subject: [PATCH] Issue #24377: Fix a ref leak in OrderedDict.__repr__. --- Misc/NEWS | 2 ++ Objects/odictobject.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS b/Misc/NEWS index de915a1c915..c4bfa701e5e 100644 --- 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? ================================== diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 79ac8262071..55055ac0999 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -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)