[3.13] Fix possible null pointer dereference of freevars in _PyCompile_LookupArg (gh-126238) (#126475)

[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 8525c9375f)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This commit is contained in:
Valery Fedorenko 2024-11-06 11:10:04 +03:00 committed by GitHub
parent ba86632f7e
commit 8059351051
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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