From a16a96911ac6e817505c5eb1522ec8f76368af15 Mon Sep 17 00:00:00 2001 From: Phil Date: Sat, 29 Mar 2008 07:24:25 +0000 Subject: [PATCH] fix register_iconv * not sure but this looked completely wrong, as 'iconv' is a function. * if iconv_cd is NULL, iconv_count is 0 and therefore realloc should do the same as malloc here. git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1069 7f574dfc-610e-0410-a909-a81674777703 --- src/conky.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/conky.c b/src/conky.c index 8edbc241..f22f4956 100644 --- a/src/conky.c +++ b/src/conky.c @@ -387,11 +387,7 @@ static iconv_t **iconv_cd = 0; int register_iconv(iconv_t *new_iconv) { - if (iconv_cd) { - iconv_cd = realloc(iconv, sizeof(iconv_t *) * (iconv_count + 1)); - } else { - iconv_cd = malloc(sizeof(iconv_t *)); - } + iconv_cd = realloc(iconv_cd, sizeof(iconv_t *) * (iconv_count + 1)); if (!iconv_cd) { CRIT_ERR("Out of memory"); }