mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Properly handle a NULL returned from PyArena_New().
Klocwork #364. Will port to head.
This commit is contained in:
parent
48829ba61d
commit
ece448efa0
1 changed files with 4 additions and 2 deletions
|
@ -797,6 +797,8 @@ parse_source_module(const char *pathname, FILE *fp)
|
||||||
PyCodeObject *co = NULL;
|
PyCodeObject *co = NULL;
|
||||||
mod_ty mod;
|
mod_ty mod;
|
||||||
PyArena *arena = PyArena_New();
|
PyArena *arena = PyArena_New();
|
||||||
|
if (arena == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
mod = PyParser_ASTFromFile(fp, pathname, Py_file_input, 0, 0, 0,
|
mod = PyParser_ASTFromFile(fp, pathname, Py_file_input, 0, 0, 0,
|
||||||
NULL, arena);
|
NULL, arena);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue