1 Star 0 Fork 76

gys/rpm

forked from src-openEuler/rpm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-memleak-when-fsmRename-failed-in-fsmCommit.patch 680 Bytes
一键复制 编辑 原始数据 按行查看 历史
From 688c4ad34d197055eb8f58fb4e45065af881598c Mon Sep 17 00:00:00 2001
From: xujing <xujing125@huawei.com>
Date: Mon, 28 Nov 2022 11:10:19 +0800
Subject: [PATCH 1/3] Fix memleak when fsmRename failed in fsmCommit
The "dest" is alloced in fsmFsPath but not freed when fsmRename failed
in fsmCommit. Fix it.
---
lib/fsm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/fsm.c b/lib/fsm.c
index 7987abbc9..e38155df7 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -782,7 +782,8 @@ static int fsmCommit(int dirfd, char **path, rpmfi fi, rpmFileAction action, con
}
free(*path);
*path = dest;
- }
+ } else
+ free(dest);
}
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gys66/rpm.git
git@gitee.com:gys66/rpm.git
gys66
rpm
rpm
master

搜索帮助