From: Petr Viktorin Date: Thu, 30 Apr 2026 10:05:48 +0000 (+0200) Subject: gh-149122: Fix refleak in codegen (GH-149179) X-Git-Tag: v3.15.0b1~159 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4599335a83a22cf73a0c20e3692c29fd0278d23b;p=thirdparty%2FPython%2Fcpython.git gh-149122: Fix refleak in codegen (GH-149179) --- diff --git a/Python/codegen.c b/Python/codegen.c index a371bf332b6d..a77451152c60 100644 --- a/Python/codegen.c +++ b/Python/codegen.c @@ -3962,8 +3962,10 @@ maybe_optimize_function_call(compiler *c, expr_ty e, jump_target_label end) expr_ty generator_exp = asdl_seq_GET(args, 0); PySTEntryObject *generator_entry = _PySymtable_Lookup(SYMTABLE(c), (void *)generator_exp); if (generator_entry->ste_coroutine) { + Py_DECREF(generator_entry); return 0; } + Py_DECREF(generator_entry); location loc = LOC(func);