From: Gunnar Beutner Date: Sat, 26 May 2012 19:36:24 +0000 (+0200) Subject: Fixed compilation on *NIX. X-Git-Tag: v0.0.1~477^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ffaff19a818fd72d2951eb5dc377ffcb4c56d7e;p=icinga2 Fixed compilation on *NIX. --- 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