Fix a reference leak in the compiler for compiler_lambda() (GH-24382)

This commit is contained in:
Pablo Galindo 2021-01-29 22:40:59 +00:00 committed by GitHub
parent 0837f99d33
commit 7fdab8331b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);