diff options
Diffstat (limited to 'src/bindfs.c')
-rw-r--r-- | src/bindfs.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/bindfs.c b/src/bindfs.c index dcb7a6f..3ee8ac5 100644 --- a/src/bindfs.c +++ b/src/bindfs.c @@ -248,6 +248,8 @@ static int is_mirrored_user(uid_t uid) static char * process_path(const char *path) { + char * res; + if (path == NULL) { /* possible? */ errno = EINVAL; return NULL; @@ -259,10 +261,13 @@ static char * process_path(const char *path) if (*path == '\0') path = "."; - if (settings.resolve_symlinks) - return realpath(path, NULL); - else - return strdup(path); + if (settings.resolve_symlinks) { + res = realpath(path, NULL); + if (res) + return res; + } + + return strdup(path); } static int getattr_common(const char *procpath, struct stat *stbuf) |