]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] Fix unlikely potential reference leak in _locale._getdefaultlocale (GH-145250...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 27 Feb 2026 08:31:11 +0000 (09:31 +0100)
committerGitHub <noreply@github.com>
Fri, 27 Feb 2026 08:31:11 +0000 (08:31 +0000)
It occurs in a code which perhaps never executed.
(cherry picked from commit 6ea84b2726bb6a1a8a6819d30c368ac34c50eabe)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Modules/_localemodule.c

index cb448b14d8cd63206029e638bcf6dd7c6c2ad262..b1d9e74db623cb80dfa8f2c2d43c765e22ee42d1 100644 (file)
@@ -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