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 d891134b7b..467c318149 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +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 diff --git a/lib/striconv.c b/lib/striconv.c index 25d1f05efd..35bae57688 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.30.2