diff options
author | Kirill Podoprigora <kirill.bast9@mail.ru> | 2023-07-21 07:56:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-21 13:56:58 +0900 |
commit | 85ed1d24427bf3e000467aab7ee1b0322b0a9013 (patch) | |
tree | f74f813c436ab4afe921eb80f07206a031d49f9f /Python/compile.c | |
parent | a31dea1feb61793e48fa9aa5014f358352205c1d (diff) | |
download | cpython-85ed1d24427bf3e000467aab7ee1b0322b0a9013.tar.gz cpython-85ed1d24427bf3e000467aab7ee1b0322b0a9013.zip |
gh-106916: Add missing error check _PyCompile_CleanDoc (#106921)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c index d5405b46561..9a13ab525d8 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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) { |