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; diff --git a/base/i2-base.h b/base/i2-base.h index c9795adb6..151488063 100644 --- a/base/i2-base.h +++ b/base/i2-base.h @@ -81,6 +81,7 @@ #include #include +#include #include #include #include