lib/striconv.c (str_cd_iconv): Avoid if before free.
authorSimon Josefsson <simon@josefsson.org>
Tue, 12 Jan 2010 21:01:53 +0000 (22:01 +0100)
committerSimon Josefsson <simon@josefsson.org>
Tue, 12 Jan 2010 21:01:53 +0000 (22:01 +0100)
ChangeLog
lib/striconv.c

index d891134..467c318 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 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
        VC_LIST_ALWAYS_EXCLUDE_REGEX.
 
index 25d1f05..35bae57 100644 (file)
@@ -233,8 +233,7 @@ str_cd_iconv (const char *src, iconv_t cd)
     (result != NULL ? realloc (result, length + 1) : malloc (length + 1));
   if (final_result == NULL)
     {
-      if (result != NULL)
-        free (result);
+      free (result);
       errno = ENOMEM;
       return NULL;
     }