Skip to content

Commit

Permalink
pythongh-120385: Fix reference leak in symtable (python#120386)
Browse files Browse the repository at this point in the history
Decref 'new_ste' if symtable_visit_annotations() fails.
  • Loading branch information
Eclips4 authored and mrahtz committed Jun 30, 2024
1 parent 4d24bf9 commit 00238f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Python/symtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 00238f6

Please sign in to comment.