diff --git a/syscall/fs_syscall.c b/syscall/fs_syscall.c index da90e29357326e6cd148fe6e6d4f384ab0573382..99cd5213b7cf0d9837595eaee4c8ff323d2a50d5 100755 --- a/syscall/fs_syscall.c +++ b/syscall/fs_syscall.c @@ -119,7 +119,10 @@ static int GetFullpathNull(int fd, const char *path, char **filePath) if (ret < 0) { return -get_errno(); } - fullPath = file->f_path; + fullPath = strdup(file->f_path); + if (fullPath == NULL) { + ret = -ENOMEM; + } } else { ret = GetFullpath(fd, path, &fullPath); if (ret < 0) {