]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix unlikely potential reference leak in _locale._getdefaultlocale (GH-145250)
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 27 Feb 2026 08:02:19 +0000 (10:02 +0200)
committerGitHub <noreply@github.com>
Fri, 27 Feb 2026 08:02:19 +0000 (08:02 +0000)
It occurs in a code which perhaps never executed.

Modules/_localemodule.c

index 7174eebd0c94de4912d475201faffb3346beb9f3..f0a418ee5024e3fd6986e033183c7bc076e9715f 100644 (file)
@@ -567,7 +567,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