aboutsummaryrefslogtreecommitdiff
path: root/iconv/gconv_db.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-08-04 21:58:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-08-04 21:58:10 +0000
commit7c11c4a14684f23babd5060931529f095b8f81d3 (patch)
tree1376da71d6f5dc84720637524c52f902c23c4681 /iconv/gconv_db.c
parent01f7e9281469ade588b61111eac9911d9a48a1ff (diff)
downloadglibc-7c11c4a14684f23babd5060931529f095b8f81d3.zip
glibc-7c11c4a14684f23babd5060931529f095b8f81d3.tar.gz
glibc-7c11c4a14684f23babd5060931529f095b8f81d3.tar.bz2
(do_release_all): Add __libc_freeres_fn_section.
Diffstat (limited to 'iconv/gconv_db.c')
-rw-r--r--iconv/gconv_db.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c
index a21f8dd..719ff95 100644
--- a/iconv/gconv_db.c
+++ b/iconv/gconv_db.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <sys/param.h>
#include <bits/libc-lock.h>
+#include <locale/localeinfo.h>
#include <dlfcn.h>
#include <gconv_int.h>
@@ -170,7 +171,7 @@ add_derivation (const char *fromset, const char *toset,
not all memory will be freed. */
}
-static void
+static void __libc_freeres_fn_section
free_derivation (void *p)
{
struct known_derivation *deriv = (struct known_derivation *) p;
@@ -765,7 +766,7 @@ __gconv_close_transform (struct __gconv_step *steps, size_t nsteps)
/* Free the modules mentioned. */
static void
-internal_function
+internal_function __libc_freeres_fn_section
free_modules_db (struct gconv_module *node)
{
if (node->left != NULL)
@@ -786,6 +787,10 @@ free_modules_db (struct gconv_module *node)
/* Free all resources if necessary. */
libc_freeres_fn (free_mem)
{
+ /* First free locale memory. This needs to be done before freeing derivations,
+ as ctype cleanup functions dereference steps arrays which we free below. */
+ _nl_locale_subfreeres ();
+
if (__gconv_alias_db != NULL)
__tdestroy (__gconv_alias_db, free);