From f5c46003b1972cad072c2eda368c566ae2d596b0 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Tue, 12 Jan 2010 22:01:53 +0100 Subject: [PATCH] lib/striconv.c (str_cd_iconv): Avoid if before free. --- ChangeLog | 4 ++++ lib/striconv.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d891134b7..467c31814 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-12 Simon Josefsson + * lib/striconv.c (str_cd_iconv): Avoid if before free. + +2010-01-12 Simon Josefsson + * top/maint.mk (VC_LIST_EXCEPT): Filter list through VC_LIST_ALWAYS_EXCLUDE_REGEX. diff --git a/lib/striconv.c b/lib/striconv.c index 25d1f05ef..35bae5768 100644 --- a/lib/striconv.c +++ b/lib/striconv.c @@ -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; } -- 2.11.0