]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a reference leak in the compiler for compiler_lambda() (GH-24382)
authorPablo Galindo <Pablogsal@gmail.com>
Fri, 29 Jan 2021 22:40:59 +0000 (22:40 +0000)
committerGitHub <noreply@github.com>
Fri, 29 Jan 2021 22:40:59 +0000 (22:40 +0000)
Python/compile.c

index d8fea9d047d0c03df162f91defbcf7d221230d02..5d06a8342d32e2bdc6d9724fe3e9df880f115fb9 100644 (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);