localcharset: Assume ANSI C behaviour of free().
authorBruno Haible <bruno@clisp.org>
Mon, 28 Feb 2011 22:39:24 +0000 (23:39 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 28 Feb 2011 22:39:24 +0000 (23:39 +0100)
* lib/localcharset.c (get_charset_aliases): Remove NULL test before
calling free().
Suggested by Simon Josefsson <simon@josefsson.org>.

ChangeLog
lib/localcharset.c

index eaecb2e..3f7bd50 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-02-28  Bruno Haible  <bruno@clisp.org>
+
+       localcharset: Assume ANSI C behaviour of free().
+       * lib/localcharset.c (get_charset_aliases): Remove NULL test before
+       calling free().
+       Suggested by Simon Josefsson <simon@josefsson.org>.
+
 2011-02-28  Corinna Vinschen  <vinschen@redhat.com>  (tiny change)
             Charles Wilson  <cygwin@cwilson.fastmail.fm>  (tiny change)
             Bruno Haible  <bruno@clisp.org>  (tiny change)
index e96188b..38e36ef 100644 (file)
@@ -228,8 +228,7 @@ get_charset_aliases (void)
                         {
                           /* Out of memory. */
                           res_size = 0;
-                          if (old_res_ptr != NULL)
-                            free (old_res_ptr);
+                          free (old_res_ptr);
                           break;
                         }
                       strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);