From 2ffaff19a818fd72d2951eb5dc377ffcb4c56d7e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 26 May 2012 21:36:24 +0200 Subject: [PATCH] Fixed compilation on *NIX. --- base/application.cpp | 5 ++++- base/i2-base.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) 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