gh-106916: Add missing error check _PyCompile_CleanDoc (#106921)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Kirill Podoprigora 2023-07-21 07:56:58 +03:00 committed by GitHub
parent a31dea1feb
commit 85ed1d2442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -8053,6 +8053,12 @@ _PyCompile_CleanDoc(PyObject *doc)
}
char *buff = PyMem_Malloc(doc_size);
if (buff == NULL){
Py_DECREF(doc);
PyErr_NoMemory();
return NULL;
}
char *w = buff;
while (p < pend) {