From ad4421c3f53b7d4b69bd8560029782295f36c4af Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Nov 2013 14:25:05 +0300 Subject: add missing check. --- src/utils/paths.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/utils') 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(calloc(PATH_MAX, sizeof(char))); + if (!realPath) + return ""; realpath(str.c_str(), realPath); #else char *realPath = realpath(str.c_str(), nullptr); -- cgit v1.2.3-70-g09d2