diff --git a/syscall/fs_syscall.c b/syscall/fs_syscall.c index b0e0243f304420efdbf317fb4bebab684930244e..8fddec6a81fe0fb33ad5223b57f6ee31a57dab99 100644 --- a/syscall/fs_syscall.c +++ b/syscall/fs_syscall.c @@ -118,7 +118,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) {