]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
intl: fix memory leak in _nl_load_domain
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 26 Aug 2015 14:31:37 +0000 (07:31 -0700)
committerDaiki Ueno <ueno@gnu.org>
Thu, 27 Aug 2015 02:22:12 +0000 (11:22 +0900)
* loadmsgcat.c (_nl_load_domain):
Free data after a read failure.  See:
https://sourceware.org/bugzilla/show_bug.cgi?id=18871

gettext-runtime/intl/ChangeLog
gettext-runtime/intl/loadmsgcat.c

index 751b65b589733901834ef1ddb6bf567351a91f27..6037c2c7407254907206e71518026eba546497cb 100644 (file)
@@ -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
        (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
        (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
index 3d535ac37b7bce5960059baf5bb651956a946532..268e1bfad3e5ab920d3821646592d1bb2f910287 100644 (file)
@@ -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;