Skip to content

Commit 4a890ea

Browse files
committed
Postfix for #7169 - fix crashes caught by the tests.
1 parent 23f533e commit 4a890ea

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/common/CharSet.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ namespace Firebird {
3838
template <>
3939
inline void SimpleDelete<charset>::clear(charset* cs)
4040
{
41-
Firebird::IntlUtil::finiCharset(cs);
42-
delete cs;
41+
if (cs)
42+
{
43+
Firebird::IntlUtil::finiCharset(cs);
44+
delete cs;
45+
}
4346
}
4447

4548
}

src/intl/lc_icu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static bool texttype_default_init(texttype* tt,
5252
//const ASCII* configInfo)
5353
{
5454
AutoPtr<charset> cs(FB_NEW charset);
55-
memset(&cs, 0, sizeof(cs));
55+
memset(cs, 0, sizeof(*cs));
5656

5757
// test if that ICU charset exist
5858
if (!CSICU_charset_init(cs, charSetName))

0 commit comments

Comments
 (0)