From: Simon Josefsson Date: Tue, 12 Jan 2010 21:01:53 +0000 (+0100) Subject: lib/striconv.c (str_cd_iconv): Avoid if before free. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5c46003b1972cad072c2eda368c566ae2d596b0;p=pspp lib/striconv.c (str_cd_iconv): Avoid if before free. --- 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; }