From: Pablo Galindo Date: Fri, 29 Jan 2021 22:40:59 +0000 (+0000) Subject: Fix a reference leak in the compiler for compiler_lambda() (GH-24382) X-Git-Tag: v3.10.0a5~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7fdab8331b90e1ffcedef05a006b6e72457b793a;p=thirdparty%2FPython%2Fcpython.git Fix a reference leak in the compiler for compiler_lambda() (GH-24382) --- diff --git a/Python/compile.c b/Python/compile.c index d8fea9d047d0..5d06a8342d32 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2692,8 +2692,10 @@ compiler_lambda(struct compiler *c, expr_ty e) qualname = c->u->u_qualname; Py_INCREF(qualname); compiler_exit_scope(c); - if (co == NULL) + if (co == NULL) { + Py_DECREF(qualname); return 0; + } compiler_make_closure(c, co, funcflags, qualname); Py_DECREF(qualname);