From c037c4acc66fe7944c6027fb528c15965a9cfa58 Mon Sep 17 00:00:00 2001 From: lukai Date: Thu, 21 Jul 2022 20:24:17 +0800 Subject: [PATCH] utilxts bugfix 1. u_setDataDirectory() is not thread-safe 2. fix double free issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5I1FL?from=project-issue Signed-off-by: lukai Change-Id: Ie8752bb2ce514afd7b1c8895141d319e58208d89 --- util/js_base64.cpp | 2 -- util/js_textdecoder.cpp | 1 - 2 files changed, 3 deletions(-) diff --git a/util/js_base64.cpp b/util/js_base64.cpp index 5443144..70ef655 100755 --- a/util/js_base64.cpp +++ b/util/js_base64.cpp @@ -456,8 +456,6 @@ namespace OHOS::Util { inputDecode = static_cast(resultData) + byteOffset; CreateDecodePromise(env, inputDecode, length); } - delete[] inputString; - inputString = nullptr; return stdDecodeInfo_->promise; } void Base64::CreateDecodePromise(napi_env env, char *inputDecode, size_t length) diff --git a/util/js_textdecoder.cpp b/util/js_textdecoder.cpp index 6bb026d..2ef93df 100755 --- a/util/js_textdecoder.cpp +++ b/util/js_textdecoder.cpp @@ -42,7 +42,6 @@ namespace OHOS::Util { } } label_ = i32Flag; - SetHwIcuDirectory(); bool fatal = (i32Flag & static_cast(ConverterFlags::FATAL_FLG)) == static_cast(ConverterFlags::FATAL_FLG); -- Gitee