(add_alias): Check that so such alias is currently stored.
authordrepper <drepper>
Thu, 28 Jan 1999 16:47:22 +0000 (16:47 +0000)
committerdrepper <drepper>
Thu, 28 Jan 1999 16:47:22 +0000 (16:47 +0000)
iconv/gconv_conf.c

index ece6335..a0aae43 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);
     }