From 9d0f48c05060abcf150711a4c29ed1d87f0c165c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 28 Feb 2011 23:45:09 +0100 Subject: [PATCH] Assume ANSI C behaviour of free(). --- gettext-runtime/intl/ChangeLog | 7 +++++++ gettext-runtime/intl/localcharset.c | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index dc06757b6..13a8bf96e 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,10 @@ +2011-02-28 Bruno Haible + + Assume ANSI C behaviour of free(). + * 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/gettext-runtime/intl/localcharset.c b/gettext-runtime/intl/localcharset.c index cbcdaceb6..3aceb422f 100644 --- a/gettext-runtime/intl/localcharset.c +++ b/gettext-runtime/intl/localcharset.c @@ -229,8 +229,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.47.2