From 11a637ed5febd2bc68591abf763a4b014da82664 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 28 Feb 2011 23:39:24 +0100 Subject: [PATCH] localcharset: Assume ANSI C behaviour of free(). * lib/localcharset.c (get_charset_aliases): Remove NULL test before calling free(). Suggested by Simon Josefsson . --- ChangeLog | 7 +++++++ lib/localcharset.c | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index eaecb2e897..3f7bd50d3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-02-28 Bruno Haible + + localcharset: Assume ANSI C behaviour of free(). + * lib/localcharset.c (get_charset_aliases): Remove NULL test before + calling free(). + Suggested by Simon Josefsson . + 2011-02-28 Corinna Vinschen (tiny change) Charles Wilson (tiny change) Bruno Haible (tiny change) diff --git a/lib/localcharset.c b/lib/localcharset.c index e96188bb7a..38e36ef3c9 100644 --- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -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); -- 2.30.2