From 7c11c4a14684f23babd5060931529f095b8f81d3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 4 Aug 2004 21:58:10 +0000 Subject: (do_release_all): Add __libc_freeres_fn_section. --- iconv/gconv_db.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'iconv/gconv_db.c') 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 #include #include +#include #include #include @@ -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); -- cgit v1.2.3