From: hosali Date: Thu, 16 May 2024 14:13:13 +0000 (+0000) Subject: 0033423: Coding - Memory leak with locale conversion X-Git-Tag: V7_9_0_beta1~195 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=dc997b884bc608b9bce26e895288fb3f44ae4aa1;p=occt.git 0033423: Coding - Memory leak with locale conversion use of stack allocated temp string instead of dynamic one --- diff --git a/src/Resource/Resource_Unicode.cxx b/src/Resource/Resource_Unicode.cxx index 827a32e9ac..e3e3bd1502 100644 --- a/src/Resource/Resource_Unicode.cxx +++ b/src/Resource/Resource_Unicode.cxx @@ -309,8 +309,7 @@ Standard_Boolean Resource_Unicode::ConvertBig5ToUnicode(const Standard_CString f } else { - Standard_Utf32Char* aChar32 = new Standard_Utf32Char[1]; - aChar32[0] = uni; + Standard_Utf32Char aChar32[] = {uni}; NCollection_Utf32String aStr32(aChar32); NCollection_Utf16String aStr16 = aStr32.ToUtf16();