8000 gh-106916: Add missing error check _PyCompile_CleanDoc (#106921) · python/cpython@85ed1d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 85ed1d2

Browse files
gh-106916: Add missing error check _PyCompile_CleanDoc (#106921)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent a31dea1 commit 85ed1d2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Python/compile.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8053,6 +8053,12 @@ _PyCompile_CleanDoc(PyObject *doc)
80538053
}
80548054

80558055
char *buff = PyMem_Malloc(doc_size);
8056+
if (buff == NULL){
8057+
Py_DECREF(doc);
8058+
PyErr_NoMemory();
8059+
return NULL;
8060+
}
8061+
80568062
char *w = buff;
80578063

80588064
while (p < pend) {

0 commit comments

Comments
 (0)
0