diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-01-29 22:40:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 22:40:59 +0000 |
commit | 7fdab8331b90e1ffcedef05a006b6e72457b793a (patch) | |
tree | 3498874b6afe113554cd1a60af8e5fa3adce314d /Python/compile.c | |
parent | bpo-42323: Fix math.nextafter() on AIX (GH-24381) (diff) | |
download | cpython-7fdab8331b90e1ffcedef05a006b6e72457b793a.tar.gz cpython-7fdab8331b90e1ffcedef05a006b6e72457b793a.tar.bz2 cpython-7fdab8331b90e1ffcedef05a006b6e72457b793a.zip |
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 d8fea9d047d..5d06a8342d3 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); |