about summary refs log tree commit diff
path: root/iconv/gconv_db.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-04-28 21:56:46 +0000
committerUlrich Drepper <drepper@redhat.com>1999-04-28 21:56:46 +0000
commit390500b147a8063ea4be7313ec38cada26f9235a (patch)
treeedf14c04a0a46992ce4c04eeaf604fab99a9d960 /iconv/gconv_db.c
parentfbb9cc9129ae3efdb1652b175f57956033102876 (diff)
downloadglibc-390500b147a8063ea4be7313ec38cada26f9235a.tar.gz
glibc-390500b147a8063ea4be7313ec38cada26f9235a.tar.xz
glibc-390500b147a8063ea4be7313ec38cada26f9235a.zip
Update.
1999-04-28  Ulrich Drepper  <drepper@cygnus.com>

	* manager.c (pthread_allocate_stack): Optimize initialization of new
	thread descriptor.
Diffstat (limited to 'iconv/gconv_db.c')
-rw-r--r--iconv/gconv_db.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c
index fdc3064d5c..4abc1ae48b 100644
--- a/iconv/gconv_db.c
+++ b/iconv/gconv_db.c
@@ -139,14 +139,17 @@ add_derivation (const char *fromset, const char *toset,
     malloc (sizeof (struct known_derivation) + fromset_len + toset_len);
   if (new_deriv != NULL)
     {
-      new_deriv->from = memcpy (new_deriv + 1, fromset, fromset_len);
-      new_deriv->to = memcpy ((char *) new_deriv->from + fromset_len,
+      new_deriv->from = (char *) (new_deriv + 1);
+      new_deriv->to = memcpy (__mempcpy (new_deriv + 1, fromset, fromset_len),
 			      toset, toset_len);
 
       new_deriv->steps = handle;
       new_deriv->nsteps = nsteps;
 
-      __tsearch (new_deriv, &known_derivations, derivation_compare);
+      if (__tsearch (new_deriv, &known_derivations, derivation_compare)
+	  == NULL)
+	/* There is some kind of memory allocation problem.  */
+	free (new_deriv);
     }
   /* Please note that we don't complain if the allocation failed.  This
      is not tragically but in case we use the memory debugging facilities