https://github.com/python/cpython/commit/19435d299a1fae9ad9a6bbe6609e41ddfd7f6cbe
commit: 19435d299a1fae9ad9a6bbe6609e41ddfd7f6cbe
branch: main
author: Kirill Podoprigora <[email protected]>
committer: vstinner <[email protected]>
date: 2024-06-12T09:37:14+02:00
summary:
gh-120385: Fix reference leak in symtable (#120386)
Decref 'new_ste' if symtable_visit_annotations() fails.
files:
M Python/symtable.c
diff --git a/Python/symtable.c b/Python/symtable.c
index 287bc2bd58107d..627184da9ef4ed 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -2027,8 +2027,10 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
}
if (!symtable_visit_annotations(st, s, s->v.AsyncFunctionDef.args,
- s->v.AsyncFunctionDef.returns,
new_ste))
+ s->v.AsyncFunctionDef.returns,
new_ste)) {
+ Py_DECREF(new_ste);
VISIT_QUIT(st, 0);
+ }
if (!symtable_enter_existing_block(st, new_ste)) {
Py_DECREF(new_ste);
VISIT_QUIT(st, 0);
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]