Bug fix: Double free if no charset WCHAR_T is available. Coverity CID 12597.

This commit is contained in:
Thomas Schmitt 2015-10-08 19:27:28 +02:00
parent 01c7a0d5ec
commit 7b7da47d86
1 changed files with 2 additions and 0 deletions

View File

@ -603,7 +603,9 @@ int str2ucs(const char *icharset, const char *input, uint16_t **output)
conv_ret = iso_iconv_open(&conv, "UCS-2BE", "WCHAR_T", 0); conv_ret = iso_iconv_open(&conv, "UCS-2BE", "WCHAR_T", 0);
if (conv_ret <= 0) { if (conv_ret <= 0) {
free(wsrc_); free(wsrc_);
wsrc_ = NULL;
free(ret_); free(ret_);
ret = ret_ = NULL;
} }
} else if (result != (int) ISO_CHARSET_CONV_ERROR) } else if (result != (int) ISO_CHARSET_CONV_ERROR)
return result; return result;