From c8df5780e116a44682df91773eb9cad13e6699b0 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 9 Mar 2003 07:30:43 +0000 Subject: [PATCH] Sf patch #700047: unicode object leaks refcount on resizing Contributed by Hye-Shik Chang. --- Objects/unicodeobject.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 14318f67d3..dcfde347c3 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -276,6 +276,7 @@ int PyUnicode_Resize(PyObject **unicode, return -1; Py_UNICODE_COPY(w->str, v->str, length < v->length ? length : v->length); + Py_DECREF(*unicode); *unicode = (PyObject *)w; return 0; } -- 2.50.1