summary refs log tree commit diff
path: root/iconv/gconv_dl.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-07-24 21:30:18 +0000
committerUlrich Drepper <drepper@redhat.com>2001-07-24 21:30:18 +0000
commit0db597422f2e5aa5a15342b95b56a0c1247af27f (patch)
tree440506b1317a8543805b0b31c3b85e90975e0a2c /iconv/gconv_dl.c
parent2a28c52993c7d1f29aa00f69d39b21f0122815cf (diff)
downloadglibc-0db597422f2e5aa5a15342b95b56a0c1247af27f.tar.gz
glibc-0db597422f2e5aa5a15342b95b56a0c1247af27f.tar.xz
glibc-0db597422f2e5aa5a15342b95b56a0c1247af27f.zip
Update.
	* iconv/gconv_cache.c (find_module): Don't allocate room for the
	filename.  Use alloca, we don't need it beyond this function.
	(__gconv_release_cache): New function.
	* iconv/gconv_db.c (__gconv_close_transform): Call
	__gconv_release_cache after the steps are handled.
	* iconv/gconv_dl.c (__gconv_find_shlib): Allocate file name in the
	record as well.
	* iconv/gconv_int.h: Add prototype fpr __gconv_release_cache.
Diffstat (limited to 'iconv/gconv_dl.c')
-rw-r--r--iconv/gconv_dl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/iconv/gconv_dl.c b/iconv/gconv_dl.c
index 2ca75a81ca..990338f070 100644
--- a/iconv/gconv_dl.c
+++ b/iconv/gconv_dl.c
@@ -1,5 +1,5 @@
 /* Handle loading/unloading of shared object for transformation.
-   Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -83,11 +83,13 @@ __gconv_find_shlib (const char *name)
   if (keyp == NULL)
     {
       /* This name was not known before.  */
-      found = malloc (sizeof (struct __gconv_loaded_object));
+      size_t namelen = strlen (name) + 1;
+
+      found = malloc (sizeof (struct __gconv_loaded_object) + namelen);
       if (found != NULL)
 	{
 	  /* Point the tree node at this new structure.  */
-	  found->name = name;
+	  found->name = (char *) memcpy (found + 1, name, namelen);
 	  found->counter = -TRIES_BEFORE_UNLOAD - 1;
 	  found->handle = NULL;