From c89d28fdfc3654daf1d112e76d3b6cca80c5bb00 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 2 Oct 2012 12:54:07 +0200 Subject: [PATCH] Issue #15609: Fix refleak introduced by my last optimization --- Objects/unicodeobject.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 606aa3327c9..83f2a2a9ba8 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -13449,8 +13449,11 @@ mainformatlong(_PyUnicodeWriter *writer, PyObject *v, break; } - if (_PyLong_FormatWriter(writer, v, base, alternate) == -1) + if (_PyLong_FormatWriter(writer, v, base, alternate) == -1) { + Py_DECREF(iobj); return -1; + } + Py_DECREF(iobj); return 1; }