mirror of https://github.com/MidnightCommander/mc
Ticket #1942: MC crashes on exit when using C locale.
Starting mc with: LANG=C mc cases a crash when mc exits. No other LC_* variable was set. The issue is in src/strutil.c module. With C locale, str_init_strings() fails to set str_cnv_not_convert variable leaving it with value -1 (INVALID_CONV). str_uninit_strings() passes str_cnv_not_convert blindly to g_iconv_close() which tries to dereference it. This commit adds a check to str_uninit_strings() if str_cnv_not_convert value is valid. Signed-off-by: Andrew Borodin <aborodin@vmail.ru> Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
822a7fa624
commit
43bb84d66d
|
@ -404,7 +404,8 @@ str_init_strings (const char *termenc)
|
|||
void
|
||||
str_uninit_strings (void)
|
||||
{
|
||||
g_iconv_close (str_cnv_not_convert);
|
||||
if (str_cnv_not_convert != INVALID_CONV)
|
||||
g_iconv_close (str_cnv_not_convert);
|
||||
g_free (codeset);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue