diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-11-02 14:25:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-11-02 14:25:05 +0300 |
commit | ad4421c3f53b7d4b69bd8560029782295f36c4af (patch) | |
tree | 27d70aca3517d472b25592972a9124411f0f615d /src/utils | |
parent | ce08e67ca1d83e4413a0eec3fd034b2a59a4b376 (diff) | |
download | ManaVerse-ad4421c3f53b7d4b69bd8560029782295f36c4af.tar.gz ManaVerse-ad4421c3f53b7d4b69bd8560029782295f36c4af.tar.bz2 ManaVerse-ad4421c3f53b7d4b69bd8560029782295f36c4af.tar.xz ManaVerse-ad4421c3f53b7d4b69bd8560029782295f36c4af.zip |
add missing check.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/paths.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp index cba263027..e1a4ee03c 100644 --- a/src/utils/paths.cpp +++ b/src/utils/paths.cpp @@ -61,6 +61,8 @@ std::string getRealPath(const std::string &str) { #if defined(__OpenBSD__) || defined(__ANDROID__) || defined(__native_client__) char *realPath = reinterpret_cast<char*>(calloc(PATH_MAX, sizeof(char))); + if (!realPath) + return ""; realpath(str.c_str(), realPath); #else char *realPath = realpath(str.c_str(), nullptr); |