mirror of https://github.com/python/cpython.git
Sf patch #700047: unicode object leaks refcount on resizing
Contributed by Hye-Shik Chang.
This commit is contained in:
parent
5284b4474e
commit
c8df5780e1
|
@ -276,6 +276,7 @@ int PyUnicode_Resize(PyObject **unicode,
|
||||||
return -1;
|
return -1;
|
||||||
Py_UNICODE_COPY(w->str, v->str,
|
Py_UNICODE_COPY(w->str, v->str,
|
||||||
length < v->length ? length : v->length);
|
length < v->length ? length : v->length);
|
||||||
|
Py_DECREF(*unicode);
|
||||||
*unicode = (PyObject *)w;
|
*unicode = (PyObject *)w;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue