summaryrefslogtreecommitdiff
path: root/src/utils/paths.cpp
diff options
context:
space:
mode:
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);