]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Fix unlikely potential reference leak in _locale._getdefaultlocale (GH-145250...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 24 Mar 2026 02:18:19 +0000 (03:18 +0100)
committerGitHub <noreply@github.com>
Tue, 24 Mar 2026 02:18:19 +0000 (02:18 +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 0af5a26f4bc461bfe32a88e8d3e6aa25e9863d20..a52e129da6f5c030ee7731ac5655d357ec783c86 100644 (file)
@@ -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