From: Raymond Hettinger Date: Sun, 9 Mar 2003 07:30:43 +0000 (+0000) Subject: Sf patch #700047: unicode object leaks refcount on resizing X-Git-Tag: v2.3c1~1516 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8df5780e116a44682df91773eb9cad13e6699b0;p=thirdparty%2FPython%2Fcpython.git Sf patch #700047: unicode object leaks refcount on resizing Contributed by Hye-Shik Chang. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 14318f67d3da..dcfde347c3dc 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; }