diff options
-rw-r--r-- | gettext-runtime/intl/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-runtime/intl/dcigettext.c | 5 | ||||
-rw-r--r-- | gettext-runtime/intl/finddomain.c | 3 |
3 files changed, 11 insertions, 2 deletions
diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index ec238ef..88ac1ac 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,8 @@ +2007-08-03 Jakub Jelinek <jakub@redhat.com> + + * dcigettext.c (_nl_find_msg): Free encoding if __gconv_open failed. + * finddomain.c (_nl_find_domain): Free normalized_codeset on failure. + 2007-07-26 Jakub Jelinek <jakub@redhat.com> * gettextP.h (struct loaded_domain): Change plural to const diff --git a/gettext-runtime/intl/dcigettext.c b/gettext-runtime/intl/dcigettext.c index f81b5dc..289aab3 100644 --- a/gettext-runtime/intl/dcigettext.c +++ b/gettext-runtime/intl/dcigettext.c @@ -1109,7 +1109,10 @@ _nl_find_msg (struct loaded_l10nfile *domain_file, nothing to do. Otherwise do not use the translation at all. */ if (__builtin_expect (r != __GCONV_NULCONV, 1)) - return NULL; + { + free ((char *) encoding); + return NULL; + } convd->conv = (__gconv_t) -1; } diff --git a/gettext-runtime/intl/finddomain.c b/gettext-runtime/intl/finddomain.c index 97d098b..cab2c99 100644 --- a/gettext-runtime/intl/finddomain.c +++ b/gettext-runtime/intl/finddomain.c @@ -162,7 +162,7 @@ _nl_find_domain (const char *dirname, char *locale, if (retval == NULL) /* This means we are out of core. */ - return NULL; + goto out; if (retval->decided <= 0) _nl_load_domain (retval, domainbinding); @@ -182,6 +182,7 @@ _nl_find_domain (const char *dirname, char *locale, if (alias_value != NULL) free (locale); +out: /* The space for normalized_codeset is dynamically allocated. Free it. */ if (mask & XPG_NORM_CODESET) free ((void *) normalized_codeset); |