From 8293188f044304997e6630b18b3879123f4bd0b3 Mon Sep 17 00:00:00 2001 From: Valery Fedorenko Date: Tue, 5 Nov 2024 20:34:33 +0300 Subject: [PATCH] [3.12] 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: Valery Fedorenko Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Peter Bierma --- Python/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/compile.c b/Python/compile.c index 6050b7281fa051..56fdbfae6f613e 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1835,7 +1835,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);