diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-20 04:07:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-20 04:07:45 +0300 |
commit | 5dc9a8a99e38a22c3c690d143e32901eeef7b9ab (patch) | |
tree | 964a4018b7e094c41696e2200e3aa318445504ef /src/utils/paths.cpp | |
parent | 79737ab60e31048233eabf09da10447358b3c79e (diff) | |
download | mv-5dc9a8a99e38a22c3c690d143e32901eeef7b9ab.tar.gz mv-5dc9a8a99e38a22c3c690d143e32901eeef7b9ab.tar.bz2 mv-5dc9a8a99e38a22c3c690d143e32901eeef7b9ab.tar.xz mv-5dc9a8a99e38a22c3c690d143e32901eeef7b9ab.zip |
Fix possible crash with incorrect dirs.
Diffstat (limited to 'src/utils/paths.cpp')
-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 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; |