]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Fix possible null pointer dereference of freevars in _PyCompile_LookupArg...
authorValery Fedorenko <federicovalenso@gmail.com>
Wed, 6 Nov 2024 08:10:04 +0000 (11:10 +0300)
committerGitHub <noreply@github.com>
Wed, 6 Nov 2024 08:10:04 +0000 (08:10 +0000)
[3.13] gh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg (GH-126239)

* Replace Py_DECREF by Py_XDECREF

(cherry picked from commit 8525c9375f25e6ec0c0b5dfcab464703f6e78082)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Python/compile.c

index bf7e95e1cd73a3b400312ad0daced2d2783b8079..c3cffd3920a0282844da11edfe0fc07a09233211 100644 (file)
@@ -1815,7 +1815,7 @@ compiler_make_closure(struct compiler *c, location loc,
                     c->u->u_metadata.u_name,
                     co->co_name,
                     freevars);
-                Py_DECREF(freevars);
+                Py_XDECREF(freevars);
                 return ERROR;
             }
             ADDOP_I(c, loc, LOAD_CLOSURE, arg);