diff --git a/src/common/CharSet.h b/src/common/CharSet.h index 6437d125b7..8c9f686faf 100644 --- a/src/common/CharSet.h +++ b/src/common/CharSet.h @@ -38,8 +38,11 @@ namespace Firebird { template <> inline void SimpleDelete::clear(charset* cs) { - Firebird::IntlUtil::finiCharset(cs); - delete cs; + if (cs) + { + Firebird::IntlUtil::finiCharset(cs); + delete cs; + } } } diff --git a/src/intl/lc_icu.cpp b/src/intl/lc_icu.cpp index 2b6e157136..0f99708ff7 100644 --- a/src/intl/lc_icu.cpp +++ b/src/intl/lc_icu.cpp @@ -52,7 +52,7 @@ static bool texttype_default_init(texttype* tt, //const ASCII* configInfo) { AutoPtr cs(FB_NEW charset); - memset(&cs, 0, sizeof(cs)); + memset(cs, 0, sizeof(*cs)); // test if that ICU charset exist if (!CSICU_charset_init(cs, charSetName))