From 4a890ea1b7159d4947333bbca8399a5cce8796bf Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sat, 23 Apr 2022 21:44:00 -0300 Subject: [PATCH] Postfix for #7169 - fix crashes caught by the tests. --- src/common/CharSet.h | 7 +++++-- src/intl/lc_icu.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) 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))