summaryrefslogtreecommitdiffstats
path: root/gettext-runtime
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-08-26 07:31:37 -0700
committerDaiki Ueno <ueno@gnu.org>2015-08-27 11:22:12 +0900
commit26dd339d2c1e17b10da02309562bcf12017a2f9a (patch)
tree8d416d654c977434b304c6035dcce0dd02bcf487 /gettext-runtime
parent3a08add578ab68fdbbddb218043dc39e23499454 (diff)
downloadexternal_gettext-26dd339d2c1e17b10da02309562bcf12017a2f9a.zip
external_gettext-26dd339d2c1e17b10da02309562bcf12017a2f9a.tar.gz
external_gettext-26dd339d2c1e17b10da02309562bcf12017a2f9a.tar.bz2
intl: fix memory leak in _nl_load_domain
* loadmsgcat.c (_nl_load_domain): Free data after a read failure. See: https://sourceware.org/bugzilla/show_bug.cgi?id=18871
Diffstat (limited to 'gettext-runtime')
-rw-r--r--gettext-runtime/intl/ChangeLog11
-rw-r--r--gettext-runtime/intl/loadmsgcat.c1
2 files changed, 10 insertions, 2 deletions
diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog
index 751b65b..6037c2c 100644
--- a/gettext-runtime/intl/ChangeLog
+++ b/gettext-runtime/intl/ChangeLog
@@ -1,3 +1,10 @@
+2015-08-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ intl: fix memory leak in _nl_load_domain
+ * loadmsgcat.c (_nl_load_domain):
+ Free data after a read failure. See:
+ https://sourceware.org/bugzilla/show_bug.cgi?id=18871
+
2015-08-21 Daiki Ueno <ueno@gnu.org>
intl: Pacify compilation with pre-C99 compilers
@@ -4074,7 +4081,7 @@
(dist): Mention ChangeLog explicitly.
2001-03-04 Bruno Haible <haible@clisp.cons.org>
-
+
* dcigettext.c (ISSLASH, HAS_DEVICE, IS_ABSOLUTE_PATH,
IS_PATH_WITH_DIR): New macros.
(DCIGETTEXT): Use IS_ABSOLUTE_PATH and IS_PATH_WITH_DIR. Increment
@@ -4293,7 +4300,7 @@
(DCIGETTEXT): Change cache handing in the plural case. Don't call
plural_eval before the translation and its catalog file have been
found. Remove plindex from cache key. Add 'translation_length' and
- 'domain' to cache result.
+ 'domain' to cache result.
(_nl_find_msg): Remove index argument, return length of translation
to the caller instead. Weaken comparison of string lengths, to account
for plural entries. Call iconv() on the entire result string, not
diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c
index 3d535ac..268e1bf 100644
--- a/gettext-runtime/intl/loadmsgcat.c
+++ b/gettext-runtime/intl/loadmsgcat.c
@@ -885,6 +885,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
if (nb == -1 && errno == EINTR)
continue;
#endif
+ free (data);
goto out;
}
read_ptr += nb;