From: Bruno Haible Date: Mon, 28 Feb 2011 22:39:24 +0000 (+0100) Subject: localcharset: Assume ANSI C behaviour of free(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11a637ed5febd2bc68591abf763a4b014da82664;p=pspp localcharset: Assume ANSI C behaviour of free(). * lib/localcharset.c (get_charset_aliases): Remove NULL test before calling free(). Suggested by Simon Josefsson . --- 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);