mirror of
https://github.com/python/cpython.git
synced 2025-07-16 15:55:18 +00:00
Correct check of PyUnicode_Resize() return value.
This commit is contained in:
parent
1aad9c7dad
commit
364f6becad
1 changed files with 2 additions and 1 deletions
|
@ -2381,7 +2381,8 @@ filterunicode(PyObject *func, PyObject *strobj)
|
|||
to avoid reallocations */
|
||||
if (need < 2 * outlen)
|
||||
need = 2 * outlen;
|
||||
if (PyUnicode_Resize(&result, need)) {
|
||||
if (PyUnicode_Resize(
|
||||
&result, need) < 0) {
|
||||
Py_DECREF(item);
|
||||
goto Fail_1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue