diff --git a/src/MEDWrapper/MED_Factory.cxx b/src/MEDWrapper/MED_Factory.cxx index dbe60c051..3e354c131 100644 --- a/src/MEDWrapper/MED_Factory.cxx +++ b/src/MEDWrapper/MED_Factory.cxx @@ -55,7 +55,11 @@ namespace MED #else cosnt char* path = xmlPath.c_str(); #endif - return (GetFileAttributes(path) != INVALID_FILE_ATTRIBUTES); + bool res = (GetFileAttributes(path) != INVALID_FILE_ATTRIBUTES); +#ifdef UNICODE + delete path; +#endif + return res; #else return (access(fileName.c_str(), F_OK) == 0); #endif diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 255d2f575..42847411b 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -534,6 +534,9 @@ namespace SMESH char* path = baPath.data(); #endif LibHandle libHandle = LoadLib( path ); +#if defined(WIN32) && defined(UNICODE) + delete path; +#endif if (!libHandle) { // report any error, if occurred {