12 Star 2 Fork 53

src-openEuler/util-linux

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-libmount-fix-possible-memory-leak.patch 927 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhangyao2022 提交于 2024-07-03 14:38 . sync community patches
From 35ad7bf065db668d6604261066f049982563dabd Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 2 May 2024 10:15:29 +0200
Subject: [PATCH] libmount: fix possible memory leak
Signed-off-by: Karel Zak <kzak@redhat.com>
---
libmount/src/context_mount.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index 50e4a62..d0da770 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -541,9 +541,10 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type)
if (!rc)
rc = mnt_context_call_hooks(cxt, MNT_STAGE_MOUNT);
- if (org_type && rc != 0)
+ if (org_type && rc != 0) {
__mnt_fs_set_fstype_ptr(cxt->fs, org_type);
- org_type = NULL;
+ org_type = NULL;
+ }
if (rc == 0 && try_type && cxt->update) {
struct libmnt_fs *fs = mnt_update_get_fs(cxt->update);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/util-linux.git
git@gitee.com:src-openeuler/util-linux.git
src-openeuler
util-linux
util-linux
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385