From: Anthony Geay Date: Tue, 17 Aug 2021 08:25:41 +0000 (+0200) Subject: Memory leak hunting X-Git-Tag: V9_8_0a1~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a29d74cfb000bf5c032e5a1403958eacb66c60cf;p=modules%2Fkernel.git Memory leak hunting --- diff --git a/src/Basics/Basics_Utils.cxx b/src/Basics/Basics_Utils.cxx index 1d8fd16e0..e421e6062 100644 --- a/src/Basics/Basics_Utils.cxx +++ b/src/Basics/Basics_Utils.cxx @@ -32,6 +32,8 @@ #include #endif +#include +#include namespace Kernel_Utils { @@ -144,7 +146,8 @@ namespace Kernel_Utils std::string encode_s(const wchar_t* decoded) { - return std::string(encode(decoded)); + std::unique_ptr> tmp((char *)encode(decoded),[](char *ptr) { delete [] ptr; }); + return std::string(tmp.get()); } #ifndef WIN32