未验证 提交 a753ab4f 编写于 作者: O openharmony_ci 提交者: Gitee

!940 修复log中继续读内存已经释放的地址

Merge pull request !940 from Mupceet/init0715
...@@ -61,7 +61,7 @@ static void CmdOnRecvMessage(const TaskHandle task, const uint8_t *buffer, uint3 ...@@ -61,7 +61,7 @@ static void CmdOnRecvMessage(const TaskHandle task, const uint8_t *buffer, uint3
BEGET_ERROR_CHECK(strl != NULL, return, "pty slave path %s is invaild", realPath); BEGET_ERROR_CHECK(strl != NULL, return, "pty slave path %s is invaild", realPath);
int fd = open(realPath, O_RDWR); int fd = open(realPath, O_RDWR);
free(realPath); free(realPath);
BEGET_ERROR_CHECK(fd >= 0, return, "Failed open %s, err=%d", realPath, errno); BEGET_ERROR_CHECK(fd >= 0, return, "Failed open %s, err=%d", msg->ptyName, errno);
(void)dup2(fd, STDIN_FILENO); (void)dup2(fd, STDIN_FILENO);
(void)dup2(fd, STDOUT_FILENO); (void)dup2(fd, STDOUT_FILENO);
(void)dup2(fd, STDERR_FILENO); // Redirect fd to 0, 1, 2 (void)dup2(fd, STDERR_FILENO); // Redirect fd to 0, 1, 2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册