mirror of https://github.com/python/cpython
gh-106916: Add missing error check _PyCompile_CleanDoc (#106921)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
a31dea1feb
commit
85ed1d2442
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue