]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 28 Jan 1999 16:49:20 +0000 (16:49 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 28 Jan 1999 16:49:20 +0000 (16:49 +0000)
* locale/setlocale.c (free_mem): Don't try to free C locale data
and use setdata instead of doing it by hand.

* iconv/gconv_conf.c (add_alias): Check that so such alias is
currently stored.

* iconv/gconv_db.c (free_derivation): Free names if charsets for
first and last step.

ChangeLog
iconv/gconv_conf.c
iconv/gconv_db.c
iconv/gconv_dl.c
locale/setlocale.c

index a0237ca4b7248a35567ab21ba29eeb540479f183..7ed1ee7e313ffa374eb128f7888bd3237b0a5ec4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 1999-01-28  Ulrich Drepper  <drepper@cygnus.com>
 
+       * locale/setlocale.c (free_mem): Don't try to free C locale data
+       and use setdata instead of doing it by hand.
+
+       * iconv/gconv_conf.c (add_alias): Check that so such alias is
+       currently stored.
+
+       * iconv/gconv_db.c (free_derivation): Free names if charsets for
+       first and last step.
+
        * iconv/gconv_dl.c: Unload all modules when debugging memory use.
 
        * locale/loadlocale.c (_nl_unload_locale): Free locale name.
index ece63354da250463e117720d5561e5acfc585d17..a0aae4313857824cd13871db66999a3db48d225f 100644 (file)
@@ -206,8 +206,9 @@ add_alias (char *rp, void *modules)
                                    from, wp - from);
       new_alias->toname = new_alias->fromname + (to - from);
 
-      if (__tsearch (new_alias, &__gconv_alias_db, __gconv_alias_compare)
-         == NULL)
+      if (__tfind (new_alias, &__gconv_alias_db, __gconv_alias_compare) != NULL
+         || (__tsearch (new_alias, &__gconv_alias_db, __gconv_alias_compare)
+             == NULL))
        /* Something went wrong, free this entry.  */
        free (new_alias);
     }
index c007732736429d441206e576fcdb08d1f882716f..70cdaffbe1874c6c96bacb69a76967b304fdffa5 100644 (file)
@@ -163,6 +163,10 @@ free_derivation (void *p)
     if (deriv->steps[cnt].end_fct)
       _CALL_DL_FCT (deriv->steps[cnt].end_fct, (&deriv->steps[cnt]));
 
+  /* Free the name strings.  */
+  free ((char *) deriv->steps[0].from_name);
+  free ((char *) deriv->steps[deriv->nsteps - 1].to_name);
+
   free ((struct gconv_step *) deriv->steps);
   free (deriv);
 }
index 5650389c78a23f3950125760a0b0089b87a40aca..33f0efea90ca224725d82f81446c8f6d9e0c0836 100644 (file)
@@ -254,17 +254,15 @@ __gconv_release_shlib (struct gconv_loaded_object *handle)
 
 /* We run this if we debug the memory allocation.  */
 static void
-do_release_all (const void *nodep, VISIT value, int level)
+do_release_all (void *nodep)
 {
-  struct gconv_loaded_object *obj = *(struct gconv_loaded_object **) nodep;
-
-  if (value != preorder && value != leaf)
-    return;
+  struct gconv_loaded_object *obj = (struct gconv_loaded_object *) nodep;
 
   /* Unload the shared object.  We don't use the trick to
      catch errors since in the case an error is signalled
      something is really wrong.  */
-  _dl_close (obj->handle);
+  if (obj->handle != NULL)
+    _dl_close (obj->handle);
 
   free (obj);
 }
@@ -272,6 +270,6 @@ do_release_all (const void *nodep, VISIT value, int level)
 static void __attribute__ ((unused))
 free_mem (void)
 {
-  __twalk (loaded, do_release_all);
+  __tdestroy (loaded, do_release_all);
 }
 text_set_element (__libc_subfreeres, free_mem);
index 0f685bc355241c903cd36e3a6d7feffc69989551..dee83d7fb4d055956d166ffe1034bad0b2d4297e 100644 (file)
@@ -402,9 +402,13 @@ free_mem (void)
     {
       struct locale_data *here = *_nl_current[category];
 
+      /* If this category is already "C" don't do anything.  */
+      if (here == _nl_C[category])
+       continue;
+
       /* We have to be prepared that sometime later me still might
         need the locale information.  */
-      *_nl_current[category] = _nl_C[category];
+      setdata (category, _nl_C[category]);
       setname (category, _nl_C_name);
 
       _nl_unload_locale (here);