Sf patch #700047: unicode object leaks refcount on resizing

Contributed by Hye-Shik Chang.
This commit is contained in:
Raymond Hettinger 2003-03-09 07:30:43 +00:00
parent 5284b4474e
commit c8df5780e1

View file

@ -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;
}