summaryrefslogtreecommitdiff
path: root/src/utils/paths.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-11-02 14:25:05 +0300
committerAndrei Karas <akaras@inbox.ru>2013-11-02 14:25:05 +0300
commitad4421c3f53b7d4b69bd8560029782295f36c4af (patch)
tree27d70aca3517d472b25592972a9124411f0f615d /src/utils/paths.cpp
parentce08e67ca1d83e4413a0eec3fd034b2a59a4b376 (diff)
downloadmv-ad4421c3f53b7d4b69bd8560029782295f36c4af.tar.gz
mv-ad4421c3f53b7d4b69bd8560029782295f36c4af.tar.bz2
mv-ad4421c3f53b7d4b69bd8560029782295f36c4af.tar.xz
mv-ad4421c3f53b7d4b69bd8560029782295f36c4af.zip
add missing check.
Diffstat (limited to 'src/utils/paths.cpp')
-rw-r--r--src/utils/paths.cpp2
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);