From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 27 Feb 2026 08:31:11 +0000 (+0100) Subject: [3.14] Fix unlikely potential reference leak in _locale._getdefaultlocale (GH-145250... X-Git-Tag: v3.14.4~231 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86c846735b7fd4b31d5456d89f7cb0b3e8eee2d9;p=thirdparty%2FPython%2Fcpython.git [3.14] Fix unlikely potential reference leak in _locale._getdefaultlocale (GH-145250) (GH-145302) It occurs in a code which perhaps never executed. (cherry picked from commit 6ea84b2726bb6a1a8a6819d30c368ac34c50eabe) Co-authored-by: Serhiy Storchaka --- diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index cb448b14d8cd..b1d9e74db623 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -579,7 +579,6 @@ _locale__getdefaultlocale_impl(PyObject *module) } /* cannot determine the language code (very unlikely) */ - Py_INCREF(Py_None); return Py_BuildValue("Os", Py_None, encoding); } #endif