mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #15741: Fix potential NULL dereference. Found by Coverity.
This commit is contained in:
parent
db579d7b25
commit
07795df683
1 changed files with 2 additions and 0 deletions
|
@ -631,6 +631,8 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
mod_ty mod;
|
mod_ty mod;
|
||||||
|
|
||||||
arena = PyArena_New();
|
arena = PyArena_New();
|
||||||
|
if (arena == NULL)
|
||||||
|
goto error;
|
||||||
mod = PyAST_obj2mod(cmd, arena, mode);
|
mod = PyAST_obj2mod(cmd, arena, mode);
|
||||||
if (mod == NULL) {
|
if (mod == NULL) {
|
||||||
PyArena_Free(arena);
|
PyArena_Free(arena);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue