From f7ddb39ee18a62c22022ec84b1f5242f16abe65d Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Sat, 9 Sep 2006 18:23:29 +0000 Subject: iconv-data needs to be fully reallocated (to prevent a double-free). --- lib/easy.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/easy.c b/lib/easy.c index 37c0c9a01..0d648064d 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -613,9 +613,12 @@ CURL *curl_easy_duphandle(CURL *incurl) #endif #if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) - outcurl->outbound_cd = data->outbound_cd; - outcurl->inbound_cd = data->inbound_cd; - outcurl->utf8_cd = data->utf8_cd; + outcurl->inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, + CURL_ICONV_CODESET_OF_NETWORK); + outcurl->outbound_cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK, + CURL_ICONV_CODESET_OF_HOST); + outcurl->utf8_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, + CURL_ICONV_CODESET_FOR_UTF8); #endif Curl_easy_initHandleData(outcurl); -- cgit v1.2.3