summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-20 04:07:45 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-20 04:07:45 +0300
commit5dc9a8a99e38a22c3c690d143e32901eeef7b9ab (patch)
tree964a4018b7e094c41696e2200e3aa318445504ef
parent79737ab60e31048233eabf09da10447358b3c79e (diff)
downloadplus-5dc9a8a99e38a22c3c690d143e32901eeef7b9ab.tar.gz
plus-5dc9a8a99e38a22c3c690d143e32901eeef7b9ab.tar.bz2
plus-5dc9a8a99e38a22c3c690d143e32901eeef7b9ab.tar.xz
plus-5dc9a8a99e38a22c3c690d143e32901eeef7b9ab.zip
Fix possible crash with incorrect dirs.
-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 2ef5bb6ae..8decb6e95 100644
--- a/src/utils/paths.cpp
+++ b/src/utils/paths.cpp
@@ -43,6 +43,8 @@ std::string getRealPath(const std::string &str)
#else
char *realPath = realpath(str.c_str(), nullptr);
#endif
+ if (!realPath)
+ return "";
path = realPath;
free(realPath);
return path;