From: Bruno Haible Date: Sat, 31 May 2008 01:10:31 +0000 (+0000) Subject: Patch taken from glibc. X-Git-Tag: v0.18~405 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0f7e541e4cc9d0209cea02fe0f745772bbef0ad;p=thirdparty%2Fgettext.git Patch taken from glibc. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index c2c0260b9..00f3c66d6 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,8 @@ +2008-02-10 Jim Meyering + + * bindtextdom.c (set_binding_values): Remove useless "if" before "free". + * loadmsgcat.c (_nl_load_domain, _nl_unload_domain): Likewise. + 2008-05-27 Bruno Haible * localename.c (SUBLANG_TIBETAN_BHUTAN): Force value 2. Needed for diff --git a/gettext-runtime/intl/bindtextdom.c b/gettext-runtime/intl/bindtextdom.c index dab5d4f35..54ce061e2 100644 --- a/gettext-runtime/intl/bindtextdom.c +++ b/gettext-runtime/intl/bindtextdom.c @@ -1,5 +1,6 @@ /* Implementation of the bindtextdomain(3) function - Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2003, 2005-2006, 2008 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -178,8 +179,7 @@ set_binding_values (const char *domainname, if (__builtin_expect (result != NULL, 1)) { - if (binding->codeset != NULL) - free (binding->codeset); + free (binding->codeset); binding->codeset = result; modified = 1; diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c index 3432a8c1c..bf883a37e 100644 --- a/gettext-runtime/intl/loadmsgcat.c +++ b/gettext-runtime/intl/loadmsgcat.c @@ -1,5 +1,5 @@ /* Load needed message catalogs. - Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -1259,8 +1259,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file, /* This is an invalid revision. */ invalid: /* This is an invalid .mo file. */ - if (domain->malloced) - free (domain->malloced); + free (domain->malloced); #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); @@ -1317,12 +1316,10 @@ _nl_unload_domain (struct loaded_domain *domain) if (convd->conv != (__gconv_t) -1) __gconv_close (convd->conv); } - if (domain->conversions != NULL) - free (domain->conversions); + free (domain->conversions); __libc_rwlock_fini (domain->conversions_lock); - if (domain->malloced) - free (domain->malloced); + free (domain->malloced); # ifdef _POSIX_MAPPED_FILES if (domain->use_mmap)