From: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Date: Sat, 26 Apr 2025 10:14:14 +0000 (+0200) Subject: gh-132781: fix refleaks in `crossinterp_exceptions.h` post gh-132782 (#132989) X-Git-Tag: v3.14.0b1~274 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca12a744abd02d0d36adfb1444c1ba31623d617d;p=thirdparty%2FPython%2Fcpython.git gh-132781: fix refleaks in `crossinterp_exceptions.h` post gh-132782 (#132989) --- diff --git a/Python/crossinterp_exceptions.h b/Python/crossinterp_exceptions.h index 857c4d1e379a..ca4ca1cf123e 100644 --- a/Python/crossinterp_exceptions.h +++ b/Python/crossinterp_exceptions.h @@ -110,6 +110,7 @@ set_notshareableerror(PyThreadState *tstate, PyObject *cause, int force, const c } else { _ensure_notshareableerror(tstate, cause, force, msgobj); + Py_DECREF(msgobj); } } @@ -123,6 +124,7 @@ format_notshareableerror_v(PyThreadState *tstate, PyObject *cause, int force, } else { _ensure_notshareableerror(tstate, cause, force, msgobj); + Py_DECREF(msgobj); } }