diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-01-29 22:40:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 22:40:59 (GMT) |
commit | 7fdab8331b90e1ffcedef05a006b6e72457b793a (patch) | |
tree | 3498874b6afe113554cd1a60af8e5fa3adce314d /Python/compile.c | |
parent | 0837f99d3367ecf200033bbddfa05d061ae9f483 (diff) | |
download | cpython-7fdab8331b90e1ffcedef05a006b6e72457b793a.zip cpython-7fdab8331b90e1ffcedef05a006b6e72457b793a.tar.gz cpython-7fdab8331b90e1ffcedef05a006b6e72457b793a.tar.bz2 |
Fix a reference leak in the compiler for compiler_lambda() (GH-24382)
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index d8fea9d..5d06a83 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); |