diff options
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_expand_msdfs.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c index 177ebdb928..0772215a28 100644 --- a/source3/modules/vfs_expand_msdfs.c +++ b/source3/modules/vfs_expand_msdfs.c @@ -187,7 +187,7 @@ static int expand_msdfs_readlink(struct vfs_handle_struct *handle, result = SMB_VFS_NEXT_READLINK(handle, path, target, PATH_MAX); - if (result < 0) + if (result <= 0) return result; target[result] = '\0'; @@ -202,12 +202,9 @@ static int expand_msdfs_readlink(struct vfs_handle_struct *handle, } len = MIN(bufsiz, strlen(target)); - if (len) { - memcpy(buf, target, len); - } else { - errno = ENOENT; - return -1; - } + + memcpy(buf, target, len); + TALLOC_FREE(target); return len; } |