From 7b7da47d86b0faf078389fc41690d90fc74d9bbe Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 8 Oct 2015 19:27:28 +0200 Subject: [PATCH] Bug fix: Double free if no charset WCHAR_T is available. Coverity CID 12597. --- libisofs/util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libisofs/util.c b/libisofs/util.c index 7778455..d642ccc 100644 --- a/libisofs/util.c +++ b/libisofs/util.c @@ -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); if (conv_ret <= 0) { free(wsrc_); + wsrc_ = NULL; free(ret_); + ret = ret_ = NULL; } } else if (result != (int) ISO_CHARSET_CONV_ERROR) return result;