提交 b727a662 编写于 作者: J JinuineLi 提交者: Hongjin Li

fixed 6759354d from https://gitee.com/hongjin-li/third_party_NuttX/pulls/128

fix: memory leak

memory allocated by calloc is never released when error returned
Signed-off-by: NJinuineLi <lihongjin1@huawei.com>
Change-Id: I593bad4a833a225d2f91dc036a23e4fffdc6fd6d
上级 23f5b87d
......@@ -129,6 +129,7 @@ DIR *opendir(const char *path)
}
if (ret < 0)
{
free(dir);
goto errout_with_count;
}
dir->fd_status = DIRENT_MAGIC;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册