diff options
Diffstat (limited to 'iconv')
-rw-r--r-- | iconv/gconv_db.c | 9 | ||||
-rw-r--r-- | iconv/gconv_dl.c | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c index a21f8ddb3c..719ff95376 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); diff --git a/iconv/gconv_dl.c b/iconv/gconv_dl.c index cc7627aba2..9504017210 100644 --- a/iconv/gconv_dl.c +++ b/iconv/gconv_dl.c @@ -1,5 +1,6 @@ /* Handle loading/unloading of shared object for transformation. - Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -191,7 +192,7 @@ __gconv_release_shlib (struct __gconv_loaded_object *handle) /* We run this if we debug the memory allocation. */ -static void +static void __libc_freeres_fn_section do_release_all (void *nodep) { struct __gconv_loaded_object *obj = (struct __gconv_loaded_object *) nodep; |