8 Star 0 Fork 10

src-openEuler/sysfsutils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-lib-Fixed-a-memory-leak-in-lib-sysfs_driver.patch 861 Bytes
一键复制 编辑 原始数据 按行查看 历史
From 5777dc78d306f7b0ab407d666f8c9537bd8535fe Mon Sep 17 00:00:00 2001
From: Chris White <chwhite@redhat.com>
Date: Fri, 25 Jun 2021 18:00:25 +0000
Subject: [PATCH] lib: Fixed a memory leak in lib/sysfs_driver.c
- sysfs_get_driver_devices() had a case where the function returned
before the dev pointer was closed.
Warned-by: covscan
Signed-off-by: Chris White <chwhite@redhat.com>
---
lib/sysfs_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/sysfs_driver.c b/lib/sysfs_driver.c
index a0b9dd5..13c33cf 100644
--- a/lib/sysfs_driver.c
+++ b/lib/sysfs_driver.c
@@ -255,6 +255,7 @@ struct dlist *sysfs_get_driver_devices(struct sysfs_driver *drv)
if (!drv->devices) {
dbg_printf("Error creating device list\n");
sysfs_close_list(linklist);
+ sysfs_close_device(dev);
return NULL;
}
}
--
2.37.0.windows.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/sysfsutils.git
git@gitee.com:src-openeuler/sysfsutils.git
src-openeuler
sysfsutils
sysfsutils
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385