iconv_open() returns (iconv_t) -1 to indicate an error. We shouldn't
pass this to iconv_Close().
Reported-by: Jeremy Lavergne <jeremy@lavergne.gotdns.org>.
John Darrington suggested that this was probably the problem, and
Jeremy confirmed it with valgrind.
{
free (cvtr->tocode);
free (cvtr->fromcode);
{
free (cvtr->tocode);
free (cvtr->fromcode);
- iconv_close (cvtr->conv);
+ if (cvtr->conv != (iconv_t) -1)
+ iconv_close (cvtr->conv);