Skip to content

Commit

Permalink
[3.12] Fix possible null pointer dereference of freevars in _PyCompil…
Browse files Browse the repository at this point in the history
…e_LookupArg (gh-126238) (#126474)

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

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <[email protected]>
  • Loading branch information
3 people authored Nov 6, 2024
1 parent fc01844 commit 2f39370
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2f39370

Please sign in to comment.