mirror of
https://github.com/python/cpython
synced 2024-09-05 08:17:45 +00:00
gh-120385: Fix reference leak in symtable (#120386)
Decref 'new_ste' if symtable_visit_annotations() fails.
This commit is contained in:
parent
f5a9c34f38
commit
19435d299a
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue