From: Paul Eggert Date: Wed, 26 Aug 2015 14:31:37 +0000 (-0700) Subject: intl: fix memory leak in _nl_load_domain X-Git-Tag: v0.19.6~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26dd339d2c1e17b10da02309562bcf12017a2f9a;p=thirdparty%2Fgettext.git 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 --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 751b65b58..6037c2c74 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,10 @@ +2015-08-26 Paul Eggert + + 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 intl: Pacify compilation with pre-C99 compilers @@ -4074,7 +4081,7 @@ (dist): Mention ChangeLog explicitly. 2001-03-04 Bruno Haible - + * 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 3d535ac37..268e1bfad 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;