gh-125196: PyUnicodeWriter_Discard(NULL) does nothing (#125222)

This commit is contained in:
Victor Stinner
2024-10-10 01:32:02 +02:00
committed by GitHub
parent 9ad55e85d7
commit 1b2a5485f9
3 changed files with 6 additions and 3 deletions

View File

@@ -13455,6 +13455,9 @@ PyUnicodeWriter_Create(Py_ssize_t length)
void PyUnicodeWriter_Discard(PyUnicodeWriter *writer)
{
if (writer == NULL) {
return;
}
_PyUnicodeWriter_Dealloc((_PyUnicodeWriter*)writer);
PyMem_Free(writer);
}