gh-129271: Fix reference leak with unicode writer in fast path in the json module (#129272)

This commit is contained in:
Pablo Galindo Salgado 2025-01-25 16:54:20 +00:00 committed by GitHub
parent e119526edf
commit 7a54a653b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -417,6 +417,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
if (ret == NULL) {
goto bail;
}
PyUnicodeWriter_Discard(writer);
*next_end_ptr = next + 1;;
return ret;
}