summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-12-16 21:26:39 (GMT)
committerGitHub <noreply@github.com>2024-12-16 21:26:39 (GMT)
commit367ea893847439502e155708539917bf655beb40 (patch)
treeada2936836cda337d91fd15fcb7c88ebfab7c2ed /Python/pythonrun.c
parent71a1e79134d8716bdd5729179ca69cbc219feb94 (diff)
downloadcpython-367ea893847439502e155708539917bf655beb40.zip
cpython-367ea893847439502e155708539917bf655beb40.tar.gz
cpython-367ea893847439502e155708539917bf655beb40.tar.bz2
[3.13] Free arena on _PyCompile_AstOptimize failure in Py_CompileStringObject (GH-128006)
Free arena on _PyCompile_AstOptimize failure in Py_CompileStringObject (GH-127910) After commit 10a91d7e9 introduced arena cleanup, commit 2dfbd4f36 removed the free call when _PyCompile_AstOptimize fails. (cherry picked from commit cfeaa992ba9bad9be2687afcafd85156703d74e8) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 5891d50..f9daf81 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;
}
}