summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/Makefile1
-rw-r--r--locale/libBrokenLocale.map7
-rw-r--r--locale/setlocale.c9
3 files changed, 15 insertions, 2 deletions
diff --git a/locale/Makefile b/locale/Makefile
index 7acef573d6..90b218130d 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -45,6 +45,7 @@ extra-libs	= libBrokenLocale
 extra-libs-others = $(extra-libs)
 
 libBrokenLocale-routines = broken_cur_max
+libBrokenLocale-map = libBrokenLocale.map
 
 subdir-dirs	= programs
 vpath %.c programs
diff --git a/locale/libBrokenLocale.map b/locale/libBrokenLocale.map
new file mode 100644
index 0000000000..09752759f7
--- /dev/null
+++ b/locale/libBrokenLocale.map
@@ -0,0 +1,7 @@
+GLIBC_2.0 {
+  global:
+    __ctype_get_mb_cur_max;
+
+  local:
+    *;
+};
\ No newline at end of file
diff --git a/locale/setlocale.c b/locale/setlocale.c
index ff7192f45d..3e63b25ac2 100644
--- a/locale/setlocale.c
+++ b/locale/setlocale.c
@@ -204,8 +204,7 @@ new_composite_name (int category, const char *newnames[LC_ALL])
 static inline void
 setname (int category, const char *name)
 {
-  if (_nl_current[category] == NULL
-      && _nl_current_names[category] != _nl_C_name)
+  if (_nl_current_names[category] != _nl_C_name)
     free ((void *) _nl_current_names[category]);
 
   _nl_current_names[category] = name;
@@ -351,6 +350,9 @@ setlocale (int category, const char *locale)
       /* Critical section left.  */
       __libc_lock_unlock (__libc_setlocale_lock);
 
+      /* Free the resources (the locale path variable.  */
+      free (locale_path);
+
       return composite;
     }
   else
@@ -395,6 +397,9 @@ setlocale (int category, const char *locale)
       /* Critical section left.  */
       __libc_lock_unlock (__libc_setlocale_lock);
 
+      /* Free the resources (the locale path variable.  */
+      free (locale_path);
+
       return (char *) newname;
     }
 }