From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 24 Mar 2026 02:18:19 +0000 (+0100) Subject: [3.13] Fix unlikely potential reference leak in _locale._getdefaultlocale (GH-145250... X-Git-Tag: v3.13.13~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a4959b92c62581ead5f03ea45380a08ffe5c40f;p=thirdparty%2FPython%2Fcpython.git [3.13] Fix unlikely potential reference leak in _locale._getdefaultlocale (GH-145250) (GH-145303) 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 0af5a26f4bc4..a52e129da6f5 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -568,7 +568,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