svn commit: r359583 - stable/12/lib/libc/locale

Mark Johnston markj at FreeBSD.org
Fri Apr 3 00:32:57 UTC 2020


Author: markj
Date: Fri Apr  3 00:32:48 2020
New Revision: 359583
URL: https://svnweb.freebsd.org/changeset/base/359583

Log:
  MFC r359183:
  Fix uselocale(3) to not leak a reference to the old locale.
  
  PR:	239520

Modified:
  stable/12/lib/libc/locale/xlocale.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/locale/xlocale.c
==============================================================================
--- stable/12/lib/libc/locale/xlocale.c	Thu Apr  2 21:08:28 2020	(r359582)
+++ stable/12/lib/libc/locale/xlocale.c	Fri Apr  3 00:32:48 2020	(r359583)
@@ -163,7 +163,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