diff --git a/src/TranslationManager.cpp b/src/TranslationManager.cpp index 63f139b..673f244 100644 --- a/src/TranslationManager.cpp +++ b/src/TranslationManager.cpp @@ -50,7 +50,9 @@ std::vector TranslationManager::getSystemLanguageList() { char * locale_c_str = setlocale(LC_ALL, ""); if (locale_c_str != NULL){ std::string locale(locale_c_str); - free(locale_c_str); + if (strlen(locale_c_str) > 1) { + free(locale_c_str); + } locales.push_back(locale); if (locale.find(".") != std::string::npos) {