changeset 14400:69f4ee1aec69

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>.
author Bruno Haible <bruno@clisp.org>
date Mon, 28 Feb 2011 23:39:24 +0100
parents 5e10178f1466
children b0fdfaeb0a77
files ChangeLog lib/localcharset.c
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- a/lib/localcharset.c
+++ b/lib/localcharset.c
@@ -228,8 +228,7 @@
                         {
                           /* 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);