about summary refs log tree commit diff
path: root/iconv/gconv_conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconv/gconv_conf.c')
-rw-r--r--iconv/gconv_conf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c
index ece63354da..a0aae43138 100644
--- a/iconv/gconv_conf.c
+++ b/iconv/gconv_conf.c
@@ -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);
     }