* intl/finddomain.c (free_mem): Also free filename.
* locale/findlocale.c (free_mem): Likewise.
(_nl_find_locale): Duplicate loc_name with strdupa not strdup.
* locale/setlocale.c (free_mem): New function. Free current locale
data and set current locale to "C".
1999-01-28 Ulrich Drepper <drepper@cygnus.com>
+ * intl/finddomain.c (free_mem): Also free filename.
+ * locale/findlocale.c (free_mem): Likewise.
+ (_nl_find_locale): Duplicate loc_name with strdupa not strdup.
+ * locale/setlocale.c (free_mem): New function. Free current locale
+ data and set current locale to "C".
+
* libio/genops.c (_IO_un_link): Move #ifdef introduced in last
change in right place.
/* Handle list of needed message catalogs
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.org>, 1995.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however.
if (runp->data != NULL)
_nl_unload_domain ((struct loaded_domain *) runp->data);
runp = runp->next;
+ free ((char *) here->filename);
free (here);
}
}
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
+ Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
loc_name = (char *) *name;
/* Make a writable copy of the locale name. */
- loc_name = __strdup (loc_name);
+ loc_name = strdupa (loc_name);
/* LOCALE can consist of up to four recognized parts for the XPG syntax:
/* This means we are out of core. */
return NULL;
}
- else
- /* If the addressed locale is already available it should be
- freed. If we would not do this switching back and force
- between two locales would slowly eat up all memory. */
- free ((void *) loc_name);
if (locale_file->decided == 0)
_nl_load_locale (locale_file, category);
static void __attribute__ ((unused))
free_mem (void)
{
- int locale;
+ int category;
- for (locale = 0; locale < LC_ALL; ++locale)
+ for (category = 0; category < LC_ALL; ++category)
{
- struct loaded_l10nfile *runp = locale_file_list[locale];
+ struct loaded_l10nfile *runp = locale_file_list[category];
while (runp != NULL)
{
if (data != NULL && data->usage_count != UNDELETABLE)
_nl_unload_locale (data);
runp = runp->next;
+ free ((char *) here->filename);
free (here);
}
}
-/* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
return (char *) newname[0];
}
}
+
+
+static void __attribute__ ((unused))
+free_mem (void)
+{
+ int category;
+
+ for (category = 0; category < LC_ALL; ++category)
+ {
+ struct locale_data *here = *_nl_current[category];
+
+ /* We have to be prepared that sometime later me still might
+ need the locale information. */
+ *_nl_current[category] = _nl_C[category];
+ setname (category, _nl_C_name);
+
+ _nl_unload_locale (here);
+ }
+
+ setname (LC_ALL, _nl_C_name);
+}
+text_set_element (__libc_subfreeres, free_mem);