* locale/loadlocale.c (_nl_unload_locale): Free locale name.
This commit is contained in:
Ulrich Drepper 1999-01-28 16:05:51 +00:00
parent f84ad0b1e0
commit bb7acc5fff
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,7 @@
1999-01-28 Ulrich Drepper <drepper@cygnus.com> 1999-01-28 Ulrich Drepper <drepper@cygnus.com>
* locale/loadlocale.c (_nl_unload_locale): Free locale name.
* intl/finddomain.c (free_mem): Also free filename. * intl/finddomain.c (free_mem): Also free filename.
* locale/findlocale.c (free_mem): Likewise. * locale/findlocale.c (free_mem): Likewise.
(_nl_find_locale): Duplicate loc_name with strdupa not strdup. (_nl_find_locale): Duplicate loc_name with strdupa not strdup.

View File

@ -1,7 +1,7 @@
/* Functions to read locale data files. /* Functions to read locale data files.
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. 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 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 modify it under the terms of the GNU Library General Public License as
@ -242,6 +242,9 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
void void
_nl_unload_locale (struct locale_data *locale) _nl_unload_locale (struct locale_data *locale)
{ {
if (locale->name != NULL)
free ((void *) locale->name);
#ifdef _POSIX_MAPPED_FILES #ifdef _POSIX_MAPPED_FILES
if (locale->mmaped) if (locale->mmaped)
__munmap ((caddr_t) locale->filedata, locale->filesize); __munmap ((caddr_t) locale->filedata, locale->filesize);