From 8525c9375f25e6ec0c0b5dfcab464703f6e78082 Mon Sep 17 00:00:00 2001 From: Valery Fedorenko Date: Tue, 5 Nov 2024 20:34:33 +0300 Subject: [PATCH] gh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg (#126239) * Replace Py_DECREF by Py_XDECREF 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 4dcb9a1b5acdb3..ecca9b0b06ecf7 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -901,7 +901,7 @@ _PyCompile_LookupArg(compiler *c, PyCodeObject *co, PyObject *name) c->u->u_metadata.u_name, co->co_name, freevars); - Py_DECREF(freevars); + Py_XDECREF(freevars); return ERROR; } return arg;