leaking iconv handles, wv return type


Subject: leaking iconv handles, wv return type
From: Mike Nordell (tamlin@algonet.se)
Date: Tue Nov 14 2000 - 11:16:11 CST


XAP_EncodingManager never closes its opened iconv handles.

I _think_ it's d'tor should set the "instance" variable to zero and then
call some code like:

void deinit_values()
{
    iconv_close(iconv_handle_U2Win);
    iconv_close(iconv_handle_Win2U);
    iconv_close(iconv_handle_U2N);
    iconv_close(iconv_handle_N2U);
}

A quick look at the code suggested these changes would be safe, there might
be issues I'm not aware of.

Also, looking at wvLIDToCodePageConverter() (wv/text.c): isn't it a bit
dangerous to return a non-const char* to those static strings? Without
knowing the implementation one could easily try to free() the returned
string (thinking it might be strdup'd).

/Mike - please don't cc



This archive was generated by hypermail 2b25 : Tue Nov 14 2000 - 11:57:59 CST