]> granicus.if.org Git - icinga2/commitdiff
Fixed compilation on *NIX.
authorGunnar Beutner <gunnar.beutner@netways.de>
Sat, 26 May 2012 19:36:24 +0000 (21:36 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sat, 26 May 2012 19:38:04 +0000 (21:38 +0200)
base/application.cpp
base/i2-base.h

index 0a3210c955ff40fcea93c16333ca6b111a648283..578501ef7802c5fd648048b631ff2e1b059d6242 100644 (file)
@@ -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;
 
index c9795adb687ad3cd409683d846b35fd89ceb59de..15148806379ef81830b837354d0560ba0648b6fa 100644 (file)
@@ -81,6 +81,7 @@
 
 #include <string>
 #include <exception>
+#include <stdexcept>
 #include <sstream>
 #include <vector>
 #include <set>