diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 5891d50cd3f..f9daf8168f1 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1485,6 +1485,7 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, if (flags && (flags->cf_flags & PyCF_ONLY_AST)) { if ((flags->cf_flags & PyCF_OPTIMIZED_AST) == PyCF_OPTIMIZED_AST) { if (_PyCompile_AstOptimize(mod, filename, flags, optimize, arena) < 0) { + _PyArena_Free(arena); return NULL; } }