1 Star 0 Fork 24

sqfu/nfs-utils

forked from src-openEuler/nfs-utils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-fix-coredump-in-bl_add_disk.patch 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
hifilove 提交于 2022-10-12 17:02 . update package to v2.6.2
From c7e995c8a4a3985d1b315814d29e8d9211d6dc5e Mon Sep 17 00:00:00 2001
From: lixiaokeng <lixiaokeng@huawei.com>
Date: Tue, 30 Nov 2021 16:38:02 +0800
Subject: [PATCH 1/2] fix coredump in bl_add_disk
The serial->data is not malloced separately, so it can't be freed.
Just free(serial).
Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
---
utils/blkmapd/device-discovery.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c
index f5f9b10..2c50205 100644
--- a/utils/blkmapd/device-discovery.c
+++ b/utils/blkmapd/device-discovery.c
@@ -188,7 +188,6 @@ static void bl_add_disk(char *filepath)
if (disk && diskpath) {
if (serial) {
- free(serial->data);
free(serial);
}
return;
@@ -229,7 +228,6 @@ static void bl_add_disk(char *filepath)
disk->valid_path = path;
}
if (serial) {
- free(serial->data);
free(serial);
}
}
@@ -242,7 +240,6 @@ static void bl_add_disk(char *filepath)
free(path);
}
if (serial) {
- free(serial->data);
free(serial);
}
return;
--
2.26.1.windows.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fu-shanqing/nfs-utils.git
git@gitee.com:fu-shanqing/nfs-utils.git
fu-shanqing
nfs-utils
nfs-utils
master

搜索帮助