◐ Shell
clean mode source ↗

gh-146250: Fix memory leak in re-initialization of `SyntaxError` by brijkapadia · Pull Request #146251 · python/cpython

Added `Py_XDECREF`/`Py_XSETREF` to avoid a memory leak when calling
`SyntaxError.__init__`.

@blurb-it

aisk

picnixz

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

@brijkapadia

brijkapadia

@brijkapadia

picnixz

@brijkapadia

kumaraditya303

vstinner

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Mar 27, 2026
pythonGH-146251)

(cherry picked from commit 0de4e08)

Co-authored-by: Brij Kapadia <97006829+bkap123@users.noreply.github.com>

kumaraditya303 pushed a commit that referenced this pull request

Mar 30, 2026
…r` (GH-146251) (#146519)

* [3.13] gh-146250: Fix memory leak in re-initialization of `SyntaxError` (GH-146251)
(cherry picked from commit 0de4e08)

Co-authored-by: Brij Kapadia <97006829+bkap123@users.noreply.github.com>

* Minimize the changes

* Minimize the changes

* Minimize the changes

---------

Co-authored-by: Brij Kapadia <97006829+bkap123@users.noreply.github.com>

hugovk pushed a commit that referenced this pull request

Mar 30, 2026
…r` (GH-146251) (#146517)

Co-authored-by: Brij Kapadia <97006829+bkap123@users.noreply.github.com>

clin1234 pushed a commit to clin1234/cpython that referenced this pull request

Apr 16, 2026

ljfp pushed a commit to ljfp/cpython that referenced this pull request

Apr 25, 2026