Salome HOME
memory leaks
authoreap <eap@opencascade.com>
Thu, 19 Aug 2021 13:23:54 +0000 (16:23 +0300)
committereap <eap@opencascade.com>
Thu, 19 Aug 2021 13:23:54 +0000 (16:23 +0300)
src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx

index 18289801d3624d3aa5a12b3e3b0608522406e313..a49e74bf8b777c90e481cf21b0b6ace83bdbfcc9 100644 (file)
@@ -153,11 +153,11 @@ namespace
                                  NULL
                                  );
     if ( msgLen > 0 ) {
-#if defined( WIN32 ) && defined( UNICODE )
-      error = Kernel_Utils::encode((wchar_t*)cstr);
-#else
+#  if defined( UNICODE )
+      error = Kernel_Utils::encode_s((wchar_t*)cstr);
+#  else
       error = (char*)cstr;
-#endif
+#  endif
       LocalFree(cstr);
     }
 
@@ -277,7 +277,7 @@ namespace
     SMESH_File resultFile( outFile, /*open=*/false );
     bool ok = ( resultFile.exists() && resultFile.size() > 0 );
 
-    if (ok)
+    if ( ok )
       libraryFile._name = outFile;
     else
       error = "Can't download file " + url;
@@ -365,13 +365,13 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
 
     bool ok = false;
     typedef bool (*SignFun)(void* );
-    SignFun signFun = (SignFun) GetProc( theLibraryHandle, "SignCAD" ); 
+    SignFun signFun = (SignFun) GetProc( theLibraryHandle, "SignCAD" );
     if ( !signFun )
     {
       if ( ! getLastError( error ))
         error = SMESH_Comment( "Can't find symbol 'SignCAD' in '") << getenv( theEnvVar ) << "'";
     }
-    else 
+    else
     {
 
       SMESH_TRY;