changeset 12737:d49b651c4fd8

lib/striconv.c (str_cd_iconv): Avoid if before free.
author Simon Josefsson <simon@josefsson.org>
date Tue, 12 Jan 2010 22:01:53 +0100
parents 123f8b43a3aa
children 906355caec2a
files ChangeLog lib/striconv.c
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-01-12  Simon Josefsson  <simon@josefsson.org>
+
+	* lib/striconv.c (str_cd_iconv): Avoid if before free.
+
 2010-01-12  Simon Josefsson  <simon@josefsson.org>
 
 	* top/maint.mk (VC_LIST_EXCEPT): Filter list through
--- a/lib/striconv.c
+++ b/lib/striconv.c
@@ -233,8 +233,7 @@
     (result != NULL ? realloc (result, length + 1) : malloc (length + 1));
   if (final_result == NULL)
     {
-      if (result != NULL)
-        free (result);
+      free (result);
       errno = ENOMEM;
       return NULL;
     }