Skip to content

Commit

Permalink
Fix a reference leak in the compiler for compiler_lambda() (pythonGH-…
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal authored and adorilson committed Mar 11, 2021
1 parent 574a9d4 commit 20f1de4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 20f1de4

Please sign in to comment.