提交 cd8237fb 编写于 作者: Y yinjiaming

fixed 9a4e9677 from https://gitee.com/hgbveiu743/kernel_liteos_m/pulls/1009

fix:修复OsLs函数内存泄漏问题
当d = NULL时,path没有释放,现释放path所指向的内存

close #I6A07U
Signed-off-by: Nyinjiaming <yinjiaming@huawei.com>
Change-Id: Iee9fd8d2171c6fdcf353a48e7af385bbd1660520
上级 47103b94
......@@ -181,6 +181,7 @@ VOID OsLs(const CHAR *pathname)
d = opendir(path);
if (d == NULL) {
PRINT_ERR("No such directory = %s\n", path);
free(path);
} else {
PRINTK("Directory %s:\n", path);
do {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册