svn commit: r359584 - stable/11/lib/libc/locale
Mark Johnston
markj at FreeBSD.org
Fri Apr 3 00:45:51 UTC 2020
Author: markj
Date: Fri Apr 3 00:38:12 2020
New Revision: 359584
URL: https://svnweb.freebsd.org/changeset/base/359584
Log:
MFC r359183:
Fix uselocale(3) to not leak a reference to the old locale.
PR: 239520
Modified:
stable/11/lib/libc/locale/xlocale.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/lib/libc/locale/xlocale.c
==============================================================================
--- stable/11/lib/libc/locale/xlocale.c Fri Apr 3 00:32:48 2020 (r359583)
+++ stable/11/lib/libc/locale/xlocale.c Fri Apr 3 00:38:12 2020 (r359584)
@@ -161,7 +161,7 @@ set_thread_locale(locale_t loc)
if (NULL != l) {
xlocale_retain((struct xlocale_refcounted*)l);
}
- locale_t old = pthread_getspecific(locale_info_key);
+ locale_t old = get_thread_locale();
if ((NULL != old) && (l != old)) {
xlocale_release((struct xlocale_refcounted*)old);
}
More information about the svn-src-all
mailing list