diff --git a/base/application.cpp b/base/application.cpp index 0a3210c95..578501ef7 100644 --- a/base/application.cpp +++ b/base/application.cpp @@ -348,7 +348,10 @@ string Application::GetExeDirectory(void) const PathEnv = getenv("PATH"); if (PathEnv != NULL) { - PathEnv = Memory::StrDup(PathEnv); + PathEnv = strdup(PathEnv); + + if (PathEnv == NULL) + throw bad_alloc(); FoundPath = false;